# StateBuilders.State

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/StateBuilders.java+class:androidx.wear.protolayout.StateBuilders.State) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

<br />

```
@RequiresSchemaVersion(major = 1, minor = 0)
public final class StateBuilders.State
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` information.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State.Builder` Builder for `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/androidx/wear/protolayout/expression/AppDataKey<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataBuilders.DynamicDataValue<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State#getKeyToValueMapping()()` Gets any shared state between the provider and renderer. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State#getLastClickableId()()` Gets the ID of the clickable that was last clicked. |
| `static int` | `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State#getMaxStateEntryCount()()` Returns the maximum number for state entries that can be added to the `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` using `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State.Builder#addKeyToValueMapping(androidx.wear.protolayout.expression.AppDataKey<T>,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T>)`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataMap` | `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State#getStateMap()()` Gets any shared state between the provider and renderer. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State#toString()()` |

## Public methods

### getKeyToValueMapping

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

```
public @NonNull Map<AppDataKey<@NonNull ?>, DynamicDataBuilders.DynamicDataValue<@NonNull ?>> getKeyToValueMapping()
```

Gets any shared state between the provider and renderer.

### getLastClickableId

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

```
public @NonNull String getLastClickableId()
```

Gets the ID of the clickable that was last clicked.

### getMaxStateEntryCount

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

```
public static int getMaxStateEntryCount()
```

Returns the maximum number for state entries that can be added to the `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` using `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State.Builder#addKeyToValueMapping(androidx.wear.protolayout.expression.AppDataKey<T>,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T>)`.

The ProtoLayout state model is not designed to handle large volumes of layout provided state. So we limit the number of state entries to keep the on-the-wire size and state store update times manageable.

### getStateMap

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

```
public @NonNull DynamicDataMap getStateMap()
```

Gets any shared state between the provider and renderer. This method returns the same underlying data as `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State#getKeyToValueMapping()`.

### toString

```
public @NonNull String toString()
```