# ReportUsageRequest.Builder

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/ReportUsageRequest.java+class:androidx.appsearch.app.ReportUsageRequest.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class ReportUsageRequest.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest.Builder#Builder(java.lang.String,java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html documentId)` Creates a new `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest.Builder` instance. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest` | `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest.Builder#build()()` Builds a new `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest.Builder#setUsageTimestampMillis(long)(long usageTimestampMillis)` Sets the timestamp in milliseconds of the usage report (the time at which the document was used). |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public Builder(@NonNull String namespace, @NonNull String documentId)
```

Creates a new `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest.Builder` instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace` | The namespace of the document that was used (such as from `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument#getNamespace()`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html documentId` | The ID of document that was used (such as from `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument#getId()`. |

## Public methods

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull ReportUsageRequest build()
```

Builds a new `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest`.

### setUsageTimestampMillis

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull 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 `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()` time base.

If unset, this defaults to the current timestamp at the time that the `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest` is constructed.