ImpressionAction.BuilderBase


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


Builder for ImpressionAction.

Summary

Public constructors

BuilderBase(impressionAction: ImpressionAction)

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

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

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

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

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

Public functions

ImpressionAction

Builds an ImpressionAction.

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

T
setReferencedQualifiedId(referencedQualifiedId: String?)

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

T
setResultRankGlobal(resultRankGlobal: Int)

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

T
setResultRankInBlock(resultRankInBlock: Int)

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

Inherited functions

From androidx.appsearch.usagereporting.TakenAction.BuilderBase
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(impressionAction: ImpressionAction)

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

Parameters
impressionAction: ImpressionAction

an existing ImpressionAction object.

BuilderBase

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

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

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

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.

BuilderBase

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

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

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.

actionType: Int

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

Public functions

build

fun build(): ImpressionAction

Builds an ImpressionAction.

setQuery

Added in 1.2.0-alpha02
fun setQuery(query: String?): T

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
fun setReferencedQualifiedId(referencedQualifiedId: String?): T

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
fun setResultRankGlobal(resultRankGlobal: Int): T

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

setResultRankInBlock

Added in 1.2.0-alpha02
fun setResultRankInBlock(resultRankInBlock: Int): T

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