TakenAction.BuilderBase


@ExperimentalAppSearchApi
class TakenAction.BuilderBase<T : TakenAction.BuilderBase<T!>?>


Builder for TakenAction.

Summary

Public constructors

BuilderBase(takenAction: TakenAction)

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

BuilderBase(
    namespace: String,
    id: String,
    actionTimestampMillis: Long,
    actionType: Int
)

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

Public functions

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

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(takenAction: TakenAction)

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

Parameters
takenAction: TakenAction

an existing TakenAction object.

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(
    namespace: String,
    id: String,
    actionTimestampMillis: Long,
    actionType: Int
)

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

Parameters
namespace: String

The namespace of the TakenAction document.

id: String

The id of the TakenAction document.

actionTimestampMillis: Long

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

actionType: Int

The action type enum of the Document.

Public functions

build

Added in 1.2.0-alpha02
fun build(): TakenAction

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
fun setDocumentTtlMillis(documentTtlMillis: Long): T

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.