public final class

ClickAction.Builder

extends androidx.appsearch.usagereporting.TakenAction.BuilderImpl<ClickAction.Builder>

 java.lang.Object

↳androidx.appsearch.usagereporting.TakenAction.BuilderImpl<ClickAction.Builder>

↳androidx.appsearch.usagereporting.ClickAction.Builder

Overview

Builder for ClickAction.

Summary

Fields
from androidx.appsearch.usagereporting.TakenAction.BuilderImpl<T>mActionTimestampMillis, mActionType, mDocumentTtlMillis, mId, mNamespace
Constructors
publicBuilder(ClickAction clickAction)

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

publicBuilder(java.lang.String namespace, java.lang.String id, long actionTimestampMillis)

Constructor for ClickAction.Builder.

Methods
public ClickActionbuild()

Builds a ClickAction.

public ClickAction.BuildersetQuery(java.lang.String query)

Sets the user-entered search input (without any operators or rewriting) that yielded the SearchResult on which the user clicked.

public ClickAction.BuildersetReferencedQualifiedId(java.lang.String referencedQualifiedId)

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

public ClickAction.BuildersetResultRankGlobal(int resultRankGlobal)

Sets the global rank of the SearchResult document.

public ClickAction.BuildersetResultRankInBlock(int resultRankInBlock)

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

public ClickAction.BuildersetTimeStayOnResultMillis(long timeStayOnResultMillis)

Sets the time in milliseconds that user stays on the SearchResult document after clicking it.

from androidx.appsearch.usagereporting.TakenAction.BuilderImpl<T>setDocumentTtlMillis
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.lang.String namespace, java.lang.String id, long actionTimestampMillis)

Constructor for ClickAction.Builder.

Parameters:

namespace: Namespace for the Document. See .
id: Unique identifier for the Document. See .
actionTimestampMillis: The timestamp when the user took the action, in milliseconds since Unix epoch.

public Builder(ClickAction clickAction)

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

Parameters:

clickAction: an existing ClickAction object.

Methods

public ClickAction.Builder setQuery(java.lang.String query)

Sets the user-entered search input (without any operators or rewriting) that yielded the SearchResult on which the user clicked.

public ClickAction.Builder setReferencedQualifiedId(java.lang.String referencedQualifiedId)

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

A qualified id is a string generated by package, database, namespace, and document id. See DocumentIdUtil.createQualifiedId(String, String, String, String) for more details.

public ClickAction.Builder setResultRankInBlock(int resultRankInBlock)

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

See also: ClickAction.getResultRankInBlock()

public ClickAction.Builder setResultRankGlobal(int resultRankGlobal)

Sets the global rank of the SearchResult document.

See also: ClickAction.getResultRankGlobal()

public ClickAction.Builder setTimeStayOnResultMillis(long timeStayOnResultMillis)

Sets the time in milliseconds that user stays on the SearchResult document after clicking it.

public ClickAction build()

Builds a ClickAction.