public final class

ClickStats.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.localstorage.stats.ClickStats.Builder

Overview

Builder for ClickStats

Summary

Constructors
publicBuilder()

Methods
public ClickStatsbuild()

Builds a new ClickStats from the ClickStats.Builder.

public ClickStats.BuildersetIsGoodClick(boolean isGoodClick)

Sets the flag indicating whether the click is good or not.

public ClickStats.BuildersetResultRankGlobal(int resultRankGlobal)

Sets the global rank of the clicked result.

public ClickStats.BuildersetResultRankInBlock(int resultRankInBlock)

Sets the in-block rank of the clicked result.

public ClickStats.BuildersetTimestampMillis(long timestampMillis)

Sets the click action timestamp in milliseconds since Unix epoch.

public ClickStats.BuildersetTimeStayOnResultMillis(long timeStayOnResultMillis)

Sets the time (duration) of the user staying on the clicked result.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public ClickStats.Builder setTimestampMillis(long timestampMillis)

Sets the click action timestamp in milliseconds since Unix epoch.

public ClickStats.Builder setTimeStayOnResultMillis(long timeStayOnResultMillis)

Sets the time (duration) of the user staying on the clicked result.

public ClickStats.Builder setResultRankInBlock(int resultRankInBlock)

Sets the in-block rank of the clicked result.

public ClickStats.Builder setResultRankGlobal(int resultRankGlobal)

Sets the global rank of the clicked result.

public ClickStats.Builder setIsGoodClick(boolean isGoodClick)

Sets the flag indicating whether the click is good or not.

A good click means the user is satisfied by the clicked document. The caller should define its own criteria and set this field accordingly.

The default value is true if unset. We should treat it as a good click by default if the caller didn't specify or could not determine for several reasons:

  • It may be difficult for the caller to determine if the user is satisfied by the clicked document or not.
  • AppSearch collects search quality metrics that are related to number of good clicks. We don't want to demote the quality score aggressively by the undetermined ones.

public ClickStats build()

Builds a new ClickStats from the ClickStats.Builder.