ClickAction.Builder


@Document.BuilderProducer
public final class ClickAction.Builder extends ClickAction.BuilderBase


Builder for ClickAction.

Summary

Public constructors

Builder(@NonNull ClickAction clickAction)

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

Builder(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis
)

Constructor for ClickAction.Builder.

Inherited methods

From androidx.appsearch.usagereporting.ClickAction.BuilderBase
@NonNull ClickAction

Builds a ClickAction.

@NonNull T

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

@NonNull T
setReferencedQualifiedId(@Nullable String referencedQualifiedId)

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

@NonNull T
setResultRankGlobal(int resultRankGlobal)

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

@NonNull T
setResultRankInBlock(int resultRankInBlock)

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

@NonNull T
setTimeStayOnResultMillis(long timeStayOnResultMillis)

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

From androidx.appsearch.usagereporting.TakenAction.BuilderBase
@NonNull TakenAction

For AppSearch annotation processor requirement only.

@NonNull T
setDocumentTtlMillis(long documentTtlMillis)

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

Public constructors

Builder

Added in 1.1.0
public Builder(@NonNull ClickAction clickAction)

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

Parameters
@NonNull ClickAction clickAction

an existing ClickAction object.

Builder

Added in 1.1.0
public Builder(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis
)

Constructor for ClickAction.Builder.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

Unique identifier for the Document. See Document.Id.

long actionTimestampMillis

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