# EventBuilders.TileInteractionEvent.Builder

Artifact: [androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/EventBuilders.java+class:androidx.wear.tiles.EventBuilders.TileInteractionEvent.Builder) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

*** ** * ** ***


```
public final class EventBuilders.TileInteractionEvent.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#Builder(int,int)(int tileId, int eventType)` A builder for `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#build()()` Builds an instance from accumulated values. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#setTimestamp(java.time.Instant)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html instant)` Sets the timestamp of when the interaction was reported. |

## Public constructors

### Builder

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public Builder(int tileId, int eventType)
```

A builder for `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent`.

| Parameters |
|---|---|
| `int tileId` | the instance ID of the tile, allocated when the tile instance is added to the carousel. This ID will remain the same for this tile instance as long it is not removed from the carousel. |
| `int eventType` | the type of the `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | when the provided `eventType` is equal to `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#UNKNOWN()` or not defined by `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.EventType`. |

## Public methods

### build

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public @NonNull EventBuilders.TileInteractionEvent build()
```

Builds an instance from accumulated values.

### setTimestamp

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public @NonNull EventBuilders.TileInteractionEvent.Builder setTimestamp(@NonNull Instant instant)
```

Sets the timestamp of when the interaction was reported. Defaults to `https://developer.android.com/reference/java/time/Instant.html#now()` (Created at the time of `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#Builder(int,int)` constructor call) if not provided.