ImageObject.Builder
class ImageObject.Builder
Builder for ImageObject.
Summary
Public constructors |
|---|
Builder(copyFrom: ImageObject)Copy constructor. |
|
Constructor for an empty |
Public functions |
|
|---|---|
T |
addAlternateName(alternateName: String)Adds an alias for the item. |
Self |
addKeyword(keyword: Keyword)Appends the |
Self |
addKeyword(text: String) |
Self |
addKeywords(values: (Mutable)Iterable<Keyword!>)Appends all the |
T |
@ExperimentalAppSearchApiAdd a new action to the list of potential actions for this document. |
ImageObject |
build()Builds a |
Thing |
build()Builds a |
T |
Clears the aliases, if any, for the item. |
T |
Clear all the potential actions for this document. |
T |
setAlternateNames(alternateNames: (Mutable)List<String!>?)Sets a list of aliases for the item. |
Self |
Sets the byte representation of this image or video. |
T |
setCreationTimestampMillis(creationTimestampMillis: Long)Sets the creation timestamp for the current AppSearch entity, in milliseconds using the |
T |
setDescription(description: String?)Sets the description for the item. |
T |
setDocumentScore(documentScore: Int)Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using |
T |
setDocumentTtlMillis(documentTtlMillis: Long)Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds. |
T |
@ExperimentalAppSearchApiSets the URL for an image of the item. |
T |
Sets the name of the item. |
T |
@ExperimentalAppSearchApiSets a list of potential actions for this document. |
Self |
Sets the |
Self |
setThumbnailSha256(text: String?)Sets the |
T |
Sets the deeplink URL of the item. |
Protected properties |
|
|---|---|
(Mutable)List<String!>! |
|
ByteArray<Byte>? |
|
Long |
|
String! |
|
Int |
|
Long |
|
String! |
|
String! |
|
(Mutable)List<Keyword!> |
|
String! |
|
String! |
|
(Mutable)List<PotentialAction!>! |
|
String? |
|
String? |
|
String! |
Public constructors
Builder
Builder(namespace: String, id: String)
Constructor for an empty Builder.
| Parameters | |
|---|---|
namespace: String |
Namespace for the Document. See |
id: String |
Unique identifier for the Document. See |
Public functions
addAlternateName
fun addAlternateName(alternateName: String): T
Adds an alias for the item.
addKeywords
fun addKeywords(values: (Mutable)Iterable<Keyword!>): Self
Appends all the values.
addPotentialAction
@ExperimentalAppSearchApi
fun addPotentialAction(newPotentialAction: PotentialAction): T
Add a new action to the list of potential actions for this document.
clearAlternateNames
fun clearAlternateNames(): T
Clears the aliases, if any, for the item.
clearPotentialActions
@ExperimentalAppSearchApi
fun clearPotentialActions(): T
Clear all the potential actions for this document.
setAlternateNames
fun setAlternateNames(alternateNames: (Mutable)List<String!>?): T
Sets a list of aliases for the item.
setBytes
fun setBytes(bytes: ByteArray?): Self
Sets the byte representation of this image or video.
setCreationTimestampMillis
fun setCreationTimestampMillis(creationTimestampMillis: Long): T
Sets the creation timestamp for the current AppSearch entity, in milliseconds using the currentTimeMillis time base.
This timestamp refers to the creation time of the AppSearch entity, not when the document is written into AppSearch.
If not set, then the current timestamp will be used.
See androidx.appsearch.annotation.Document.CreationTimestampMillis for more information on creation timestamp.
setDescription
fun setDescription(description: String?): T
Sets the description for the item.
setDocumentScore
fun setDocumentScore(documentScore: Int): T
Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using RANKING_STRATEGY_DOCUMENT_SCORE.
See androidx.appsearch.annotation.Document.Score for more information on score.
setDocumentTtlMillis
fun setDocumentTtlMillis(documentTtlMillis: Long): T
Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.
The document will be automatically deleted when the TTL expires.
If not set, then the document will never expire.
See androidx.appsearch.annotation.Document.TtlMillis for more information on TTL.
setImage
@ExperimentalAppSearchApi
fun setImage(image: String?): T
Sets the URL for an image of the item.
setPotentialActions
@ExperimentalAppSearchApi
fun setPotentialActions(
newPotentialActions: (Mutable)List<PotentialAction!>?
): T
Sets a list of potential actions for this document.
setThumbnailSha256
fun setThumbnailSha256(text: String?): Self
Sets the sha256 of the thumbnail of this image of video.
setUrl
fun setUrl(url: String?): T
Sets the deeplink URL of the item.
If this item can be displayed by any system UI surface, or can be read by another Android package, through one of the androidx.appsearch.app.SetSchemaRequest.Builder methods, this url should act as a deeplink into the activity that can open it. Callers should be able to construct an ACTION_VIEW intent with the url as the setData to view the item inside your application.
See Allowing Other Apps to Start Your Activity for more details on how to make activities in your app open for use by other apps by defining intent filters.