ReportUsageRequest.Builder

public static final class ReportUsageRequest.Builder
extends Object

java.lang.Object
   ↳ androidx.appsearch.app.ReportUsageRequest.Builder


Builder for ReportUsageRequest objects.

Summary

Public constructors

Builder(String namespace, String documentId)

Creates a ReportUsageRequest.Builder instance.

Public methods

ReportUsageRequest build()

Builds a new ReportUsageRequest.

ReportUsageRequest.Builder setUsageTimestampMillis(long usageTimestampMillis)

Sets the timestamp in milliseconds of the usage report (the time at which the document was used).

Inherited methods

Public constructors

Builder

public Builder (String namespace, 
                String documentId)

Creates a ReportUsageRequest.Builder instance.

Parameters
namespace String

documentId String

Public methods

build

public ReportUsageRequest build ()

Builds a new ReportUsageRequest.

Returns
ReportUsageRequest

Throws
IllegalStateException if the builder has already been used

setUsageTimestampMillis

public ReportUsageRequest.Builder setUsageTimestampMillis (long usageTimestampMillis)

Sets the timestamp in milliseconds of the usage report (the time at which the document was used).

The value is in the System.currentTimeMillis() time base.

If unset, this defaults to the current timestamp at the time that the ReportUsageRequest is constructed.

Parameters
usageTimestampMillis long

Returns
ReportUsageRequest.Builder

Throws
IllegalStateException if the builder has already been used