DismissAction.BuilderBase


@ExperimentalAppSearchApi
public class DismissAction.BuilderBase<T extends DismissAction.BuilderBase<T>> extends TakenAction.BuilderBase

Known direct subclasses

Builder for DismissAction.

Summary

Public constructors

Constructs DismissAction.BuilderBase by copying existing values from the given DismissAction.

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

Constructs DismissAction.BuilderBase with given namespace, id, and actionTimestampMillis.

BuilderBase(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis,
    int actionType
)

Constructs DismissAction.BuilderBase with given namespace, id, actionTimestampMillis and actionType.

Public methods

@NonNull DismissAction

Builds an DismissAction.

@NonNull T

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

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

Inherited methods

From androidx.appsearch.usagereporting.TakenAction.BuilderBase
@NonNull T
setDocumentTtlMillis(long documentTtlMillis)

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

Public constructors

BuilderBase

Added in 1.2.0-alpha02
public BuilderBase(@NonNull DismissAction dismissAction)

Constructs DismissAction.BuilderBase by copying existing values from the given DismissAction.

Parameters
@NonNull DismissAction dismissAction

an existing DismissAction object.

BuilderBase

Added in 1.2.0-alpha02
public BuilderBase(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis
)

Constructs DismissAction.BuilderBase with given namespace, id, and actionTimestampMillis.

The TakenAction.ActionType for the Document returned from getActionType will be ACTION_TYPE_DISMISS.

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.

BuilderBase

public BuilderBase(
    @NonNull String namespace,
    @NonNull String id,
    long actionTimestampMillis,
    int actionType
)

Constructs DismissAction.BuilderBase with given namespace, id, actionTimestampMillis and actionType.

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.

int actionType

Action type enum for the Document. See TakenAction.ActionType.

Public methods

build

public @NonNull DismissAction build()

Builds an DismissAction.

setQuery

Added in 1.2.0-alpha02
public @NonNullsetQuery(@Nullable String query)

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

setReferencedQualifiedId

Added in 1.2.0-alpha02
public @NonNullsetReferencedQualifiedId(@Nullable String referencedQualifiedId)

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.2.0-alpha02
public @NonNullsetResultRankGlobal(int resultRankGlobal)

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

setResultRankInBlock

Added in 1.2.0-alpha02
public @NonNullsetResultRankInBlock(int resultRankInBlock)

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