public final class

ClickActionGenericDocument.Builder

extends androidx.appsearch.localstorage.usagereporting.TakenActionGenericDocument.Builder<ClickActionGenericDocument.Builder>

 java.lang.Object

androidx.appsearch.app.GenericDocument.Builder<androidx.appsearch.localstorage.usagereporting.TakenActionGenericDocument.Builder>

↳androidx.appsearch.localstorage.usagereporting.TakenActionGenericDocument.Builder<ClickActionGenericDocument.Builder>

↳androidx.appsearch.localstorage.usagereporting.ClickActionGenericDocument.Builder

Overview

Builder for ClickActionGenericDocument.

Summary

Constructors
publicBuilder(GenericDocument document)

Creates a new ClickActionGenericDocument.Builder from an existing GenericDocument.

publicBuilder(java.lang.String namespace, java.lang.String id, java.lang.String schemaType)

Creates a new ClickActionGenericDocument.Builder.

Methods
public ClickActionGenericDocumentbuild()

Builds a ClickActionGenericDocument.

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

Sets the string value of property query by the user-entered search input (without any operators or rewriting) that yielded the SearchResult on which the user clicked.

public ClickActionGenericDocument.BuildersetResultRankGlobal(int resultRankGlobal)

Sets the integer value of property resultRankGlobal by the global rank of the clicked SearchResult document.

public ClickActionGenericDocument.BuildersetResultRankInBlock(int resultRankInBlock)

Sets the integer value of property resultRankInBlock by the rank of the clicked SearchResult document among the user-defined block.

public ClickActionGenericDocument.BuildersetTimeStayOnResultMillis(long timeStayOnResultMillis)

Sets the integer value of property timeStayOnResultMillis by the time in milliseconds that user stays on the SearchResult document after clicking it.

from GenericDocument.Builder<BuilderType>clearProperty, setCreationTimestampMillis, setId, setNamespace, setParentTypes, setPropertyBoolean, setPropertyBytes, setPropertyDocument, setPropertyDouble, setPropertyEmbedding, setPropertyLong, setPropertyString, setSchemaType, setScore, setTtlMillis
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, java.lang.String schemaType)

Creates a new ClickActionGenericDocument.Builder.

Document IDs are unique within a namespace.

The number of namespaces per app should be kept small for efficiency reasons.

Parameters:

namespace: the namespace to set for the GenericDocument.
id: the unique identifier for the GenericDocument in its namespace.
schemaType: the AppSearchSchema type of the GenericDocument. The provided schemaType must be defined using AppSearchSession.setSchemaAsync(SetSchemaRequest) prior to inserting a document of this schemaType into the AppSearch index using AppSearchSession.putAsync(PutDocumentsRequest). Otherwise, the document will be rejected by AppSearchSession.putAsync(PutDocumentsRequest) with result code AppSearchResult.RESULT_NOT_FOUND.

public Builder(GenericDocument document)

Creates a new ClickActionGenericDocument.Builder from an existing GenericDocument.

Parameters:

document: a generic document object.

Methods

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

Sets the string value of property query by the user-entered search input (without any operators or rewriting) that yielded the SearchResult on which the user clicked.

public ClickActionGenericDocument.Builder setResultRankInBlock(int resultRankInBlock)

Sets the integer value of property resultRankInBlock by the rank of the clicked SearchResult document among the user-defined block.

public ClickActionGenericDocument.Builder setResultRankGlobal(int resultRankGlobal)

Sets the integer value of property resultRankGlobal by the global rank of the clicked SearchResult document.

public ClickActionGenericDocument.Builder setTimeStayOnResultMillis(long timeStayOnResultMillis)

Sets the integer value of property timeStayOnResultMillis by the time in milliseconds that user stays on the SearchResult document after clicking it.

Builds a ClickActionGenericDocument.