ClickAction.Builder


@Document.BuilderProducer
class ClickAction.Builder : ClickAction.BuilderBase


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.

Inherited functions

From androidx.appsearch.usagereporting.ClickAction.BuilderBase
ClickAction

Builds a ClickAction.

T
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.

T
setReferencedQualifiedId(referencedQualifiedId: String?)

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

T
setResultRankGlobal(resultRankGlobal: Int)

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

T
setResultRankInBlock(resultRankInBlock: Int)

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

T
setTimeStayOnResultMillis(timeStayOnResultMillis: Long)

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

From androidx.appsearch.usagereporting.TakenAction.BuilderBase
TakenAction

For AppSearch annotation processor requirement only.

T
setDocumentTtlMillis(documentTtlMillis: Long)

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

Public constructors

Builder

Added in 1.1.0
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
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.