TakenAction.BuilderBase


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


Builder for TakenAction.

Summary

Public constructors

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

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

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

Public methods

@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

BuilderBase

Added in 1.2.0-alpha02
public BuilderBase(@NonNull TakenAction takenAction)

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

Parameters
@NonNull TakenAction takenAction

an existing TakenAction object.

BuilderBase

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

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

Parameters
@NonNull String namespace

The namespace of the TakenAction document.

@NonNull String id

The id of the TakenAction document.

long actionTimestampMillis

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

int actionType

The action type enum of the Document.

Public methods

build

Added in 1.2.0-alpha02
public @NonNull TakenAction build()

For AppSearch annotation processor requirement only. The client should never call it since it is impossible to instantiate an abstract class.

setDocumentTtlMillis

Added in 1.2.0-alpha02
public @NonNullsetDocumentTtlMillis(long documentTtlMillis)

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.