ReportSystemUsageRequest.Builder

public static final class ReportSystemUsageRequest.Builder
extends Object

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


Builder for ReportSystemUsageRequest objects.

Summary

Public constructors

Builder(String packageName, String database, String namespace, String documentId)

Creates a ReportSystemUsageRequest.Builder instance.

Public methods

ReportSystemUsageRequest build()

Builds a new ReportSystemUsageRequest.

ReportSystemUsageRequest.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 packageName, 
                String database, 
                String namespace, 
                String documentId)

Creates a ReportSystemUsageRequest.Builder instance.

Parameters
packageName String

database String

namespace String

documentId String

Public methods

build

public ReportSystemUsageRequest build ()

Builds a new ReportSystemUsageRequest.

Returns
ReportSystemUsageRequest

Throws
IllegalStateException if the builder has already been used

setUsageTimestampMillis

public ReportSystemUsageRequest.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 ReportSystemUsageRequest is constructed.

Parameters
usageTimestampMillis long

Returns
ReportSystemUsageRequest.Builder

Throws
IllegalStateException if the builder has already been used