ImpressionAction.Builder
@Document.BuilderProducer
public final class ImpressionAction.Builder
Builder for ImpressionAction.
Summary
Public constructors |
|---|
Builder(@NonNull ImpressionAction impressionAction)Constructs |
|
Constructor for |
Public methods |
|
|---|---|
@NonNull ImpressionAction |
build()Builds an |
@NonNull TakenAction |
build()For AppSearch annotation processor requirement only. |
@NonNull T |
setDocumentTtlMillis(long documentTtlMillis)Sets the time-to-live (TTL) of the |
@NonNull T |
Sets the user-entered search input (without any operators or rewriting) that yielded the |
@NonNull T |
setReferencedQualifiedId(@Nullable String referencedQualifiedId)Sets the qualified id of the |
@NonNull T |
setResultRankGlobal(int resultRankGlobal)Sets the global rank of the |
@NonNull T |
setResultRankInBlock(int resultRankInBlock)Sets the rank of the |
Public constructors
Builder
public Builder(@NonNull ImpressionAction impressionAction)
Constructs ImpressionAction.Builder by copying existing values from the given ImpressionAction.
| Parameters | |
|---|---|
@NonNull ImpressionAction impressionAction |
an existing |
Builder
public Builder(
@NonNull String namespace,
@NonNull String id,
long actionTimestampMillis
)
Constructor for ImpressionAction.Builder.
| Parameters | |
|---|---|
@NonNull String namespace |
Namespace for the Document. See |
@NonNull String id |
Unique identifier for the Document. See |
long actionTimestampMillis |
The timestamp when the user took the action, in milliseconds since Unix epoch. |
Public methods
build
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
public @NonNull T setDocumentTtlMillis(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.
setQuery
public @NonNull T setQuery(@Nullable String query)
Sets the user-entered search input (without any operators or rewriting) that yielded the androidx.appsearch.app.SearchResult which impressed the user.
setReferencedQualifiedId
public @NonNull T setReferencedQualifiedId(@Nullable String referencedQualifiedId)
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
public @NonNull T setResultRankGlobal(int resultRankGlobal)
Sets the global rank of the androidx.appsearch.app.SearchResult document.
| See also | |
|---|---|
getResultRankGlobal |
setResultRankInBlock
public @NonNull T setResultRankInBlock(int resultRankInBlock)
Sets the rank of the androidx.appsearch.app.SearchResult document among the user-defined block.
| See also | |
|---|---|
getResultRankInBlock |