SearchAction.BuilderBase


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

Known direct subclasses

Builder for SearchAction.

Summary

Public constructors

Constructor for SearchAction.BuilderBase with all the existing values.

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

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

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

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

Public methods

@NonNull SearchAction

Builds a SearchAction.

@NonNull T
setFetchedResultCount(int fetchedResultCount)

Sets total number of results fetched from AppSearch by the client in this SearchAction.

@NonNull T

Sets the user-entered search input (without any operators or rewriting).

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 SearchAction searchAction)

Constructor for SearchAction.BuilderBase with all the existing values.

BuilderBase

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

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

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

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 SearchAction.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 SearchAction build()

Builds a SearchAction.

setFetchedResultCount

Added in 1.2.0-alpha02
public @NonNullsetFetchedResultCount(int fetchedResultCount)

Sets total number of results fetched from AppSearch by the client in this SearchAction.

setQuery

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

Sets the user-entered search input (without any operators or rewriting).