DismissAction.Builder
@Document.BuilderProducer
public final class DismissAction.Builder
Builder for DismissAction.
Summary
Public constructors |
|---|
Builder(@NonNull DismissAction dismissAction)Constructs |
|
Constructor for |
Public methods |
|
|---|---|
@NonNull DismissAction |
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 |
Protected fields
Public constructors
Builder
public Builder(@NonNull DismissAction dismissAction)
Constructs DismissAction.Builder by copying existing values from the given DismissAction.
| Parameters | |
|---|---|
@NonNull DismissAction dismissAction |
an existing |
Builder
public Builder(
@NonNull String namespace,
@NonNull String id,
long actionTimestampMillis
)
Constructor for DismissAction.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 |