DismissAction.Builder


@Document.BuilderProducer
class DismissAction.Builder


Builder for DismissAction.

Summary

Public constructors

Builder(dismissAction: DismissAction)

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

Builder(namespace: String, id: String, actionTimestampMillis: Long)

Constructor for DismissAction.Builder.

Public functions

DismissAction

Builds an DismissAction.

T
setDocumentTtlMillis(documentTtlMillis: Long)

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

DismissAction.Builder
setQuery(query: String?)

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

DismissAction.Builder
setReferencedQualifiedId(referencedQualifiedId: String?)

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

DismissAction.Builder
setResultRankGlobal(resultRankGlobal: Int)

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

DismissAction.Builder
setResultRankInBlock(resultRankInBlock: Int)

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

Public constructors

Builder

Added in 1.1.0-alpha07
Builder(dismissAction: DismissAction)

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

Parameters
dismissAction: DismissAction

an existing DismissAction object.

Builder

Added in 1.1.0-alpha07
Builder(namespace: String, id: String, actionTimestampMillis: Long)

Constructor for DismissAction.Builder.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

actionTimestampMillis: Long

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

Public functions

build

Added in 1.1.0-alpha07
fun build(): DismissAction

Builds an DismissAction.

setDocumentTtlMillis

Added in 1.1.0-alpha07
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.

setQuery

Added in 1.1.0-alpha07
fun setQuery(query: String?): DismissAction.Builder

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.1.0-alpha07
fun setReferencedQualifiedId(referencedQualifiedId: String?): DismissAction.Builder

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.1.0-alpha07
fun setResultRankGlobal(resultRankGlobal: Int): DismissAction.Builder

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

setResultRankInBlock

Added in 1.1.0-alpha07
fun setResultRankInBlock(resultRankInBlock: Int): DismissAction.Builder

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

Protected properties

mActionTimestampMillis

protected val mActionTimestampMillisLong

mActionType

protected val mActionTypeInt

mDocumentTtlMillis

protected val mDocumentTtlMillisLong

mId

protected val mIdString!

mNamespace

protected val mNamespaceString!