ClickAction.Builder


@Document.BuilderProducer
class ClickAction.Builder


Builder for ClickAction.

Summary

Public constructors

Builder(clickAction: ClickAction)

Constructs ClickAction.Builder by copying existing values from the given ClickAction.

Builder(namespace: String, id: String, actionTimestampMillis: Long)

Constructor for ClickAction.Builder.

Public functions

ClickAction

Builds a ClickAction.

T
setDocumentTtlMillis(documentTtlMillis: Long)

Sets the time-to-live (TTL) of the TakenAction document as a duration in milliseconds.

ClickAction.Builder
setQuery(query: String?)

Sets the user-entered search input (without any operators or rewriting) that yielded the androidx.appsearch.app.SearchResult on which the user clicked.

ClickAction.Builder
setReferencedQualifiedId(referencedQualifiedId: String?)

Sets the qualified id of the androidx.appsearch.app.SearchResult document that the user takes action on.

ClickAction.Builder
setResultRankGlobal(resultRankGlobal: Int)

Sets the global rank of the androidx.appsearch.app.SearchResult document.

ClickAction.Builder
setResultRankInBlock(resultRankInBlock: Int)

Sets the rank of the androidx.appsearch.app.SearchResult document among the user-defined block.

ClickAction.Builder
setTimeStayOnResultMillis(timeStayOnResultMillis: Long)

Sets the time in milliseconds that user stays on the androidx.appsearch.app.SearchResult document after clicking it.

Public constructors

Builder

Added in 1.1.0-alpha06
Builder(clickAction: ClickAction)

Constructs ClickAction.Builder by copying existing values from the given ClickAction.

Parameters
clickAction: ClickAction

an existing ClickAction object.

Builder

Added in 1.1.0-alpha06
Builder(namespace: String, id: String, actionTimestampMillis: Long)

Constructor for ClickAction.Builder.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

actionTimestampMillis: Long

The timestamp when the user took the action, in milliseconds since Unix epoch.

Public functions

build

Added in 1.1.0-alpha06
fun build(): ClickAction

Builds a ClickAction.

setDocumentTtlMillis

Added in 1.1.0-alpha06
fun setDocumentTtlMillis(documentTtlMillis: Long): T

Sets the time-to-live (TTL) of the TakenAction document as a duration in milliseconds.

The document will be automatically deleted when the TTL expires (since getActionTimestampMillis).

The default TTL for TakenAction document is 60 days.

See androidx.appsearch.annotation.Document.TtlMillis for more information on TTL.

setQuery

Added in 1.1.0-alpha06
fun setQuery(query: String?): ClickAction.Builder

Sets the user-entered search input (without any operators or rewriting) that yielded the androidx.appsearch.app.SearchResult on which the user clicked.

setReferencedQualifiedId

Added in 1.1.0-alpha06
fun setReferencedQualifiedId(referencedQualifiedId: String?): ClickAction.Builder

Sets the qualified id of the androidx.appsearch.app.SearchResult document that the user takes action on.

A qualified id is a string generated by package, database, namespace, and document id. See createQualifiedId for more details.

setResultRankGlobal

Added in 1.1.0-alpha06
fun setResultRankGlobal(resultRankGlobal: Int): ClickAction.Builder

Sets the global rank of the androidx.appsearch.app.SearchResult document.

setResultRankInBlock

Added in 1.1.0-alpha06
fun setResultRankInBlock(resultRankInBlock: Int): ClickAction.Builder

Sets the rank of the androidx.appsearch.app.SearchResult document among the user-defined block.

setTimeStayOnResultMillis

Added in 1.1.0-alpha06
fun setTimeStayOnResultMillis(timeStayOnResultMillis: Long): ClickAction.Builder

Sets the time in milliseconds that user stays on the androidx.appsearch.app.SearchResult document after clicking it.

Protected properties

mActionTimestampMillis

protected val mActionTimestampMillisLong

mActionType

protected val mActionTypeInt

mDocumentTtlMillis

protected val mDocumentTtlMillisLong

mId

protected val mIdString!

mNamespace

protected val mNamespaceString!