# DynamicTypeEvaluator.Config.Builder

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

*** ** * ** ***

<br />

```
public final class DynamicTypeEvaluator.Config.Builder
```

<br />

*** ** * ** ***

Builds a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#addPlatformDataProvider(androidx.wear.protolayout.expression.pipeline.PlatformDataProvider,java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider platformDataProvider, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> supportedDataKeys )` Add a platform data provider and specify the keys it can provide dynamic data for. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#build()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#setAnimationQuotaManager(androidx.wear.protolayout.expression.pipeline.QuotaManager)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/QuotaManager value)` Sets the quota manager used for limiting the number of concurrently running animations. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` | `@https://developer.android.com/reference/androidx/annotation/VisibleForTesting https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#setClock(java.util.function.Supplier<java.time.Instant>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/function/Supplier.html<https://developer.android.com/reference/java/time/Instant.html> clock)` Sets the clock (`https://developer.android.com/reference/java/time/Instant.html` supplier) used for providing time data to bindings. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#setDynamicTypesQuotaManager(androidx.wear.protolayout.expression.pipeline.QuotaManager)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/QuotaManager value)` Sets the quota manager used for limiting the total size of dynamic types in the pipeline. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#setPlatformTimeUpdateNotifier(androidx.wear.protolayout.expression.pipeline.PlatformTimeUpdateNotifier)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformTimeUpdateNotifier notifier )` Sets the notifier used for updating the platform time data. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder#setStateStore(androidx.wear.protolayout.expression.pipeline.StateStore)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/StateStore value)` Sets the state store that will be used for dereferencing the state keys in the dynamic types. |

## Public constructors

### Builder

Added in 1.0.0

```
public Builder()
```

## Public methods

### addPlatformDataProvider

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

```
public @NonNull DynamicTypeEvaluator.Config.Builder addPlatformDataProvider(
    @NonNull PlatformDataProvider platformDataProvider,
    @NonNull Set<PlatformDataKey<@NonNull ?>> supportedDataKeys
)
```

Add a platform data provider and specify the keys it can provide dynamic data for.

The provider must support at least one key. If the provider supports multiple keys, they should not be independent, as their values should always update together. One data key must not have multiple providers, or an exception will be thrown.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If a PlatformDataProvider supports an empty key set or if a key has multiple data providers. |

### build

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

```
public @NonNull DynamicTypeEvaluator.Config build()
```

### setAnimationQuotaManager

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

```
public @NonNull DynamicTypeEvaluator.Config.Builder setAnimationQuotaManager(@NonNull QuotaManager value)
```

Sets the quota manager used for limiting the number of concurrently running animations.

If not set, animations are disabled and non-infinite animations will have the end value immediately.

### setClock

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

```
@VisibleForTesting
public @NonNull DynamicTypeEvaluator.Config.Builder setClock(@NonNull Supplier<Instant> clock)
```

Sets the clock (`https://developer.android.com/reference/java/time/Instant.html` supplier) used for providing time data to bindings. If not set, on every reevaluation, platform time for dynamic values will be set to `https://developer.android.com/reference/java/time/Instant.html#now()`.

### setDynamicTypesQuotaManager

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

```
public @NonNull DynamicTypeEvaluator.Config.Builder setDynamicTypesQuotaManager(@NonNull QuotaManager value)
```

Sets the quota manager used for limiting the total size of dynamic types in the pipeline.

If not set, number of dynamic types will not be restricted.

### setPlatformTimeUpdateNotifier

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

```
public @NonNull DynamicTypeEvaluator.Config.Builder setPlatformTimeUpdateNotifier(
    @NonNull PlatformTimeUpdateNotifier notifier
)
```

Sets the notifier used for updating the platform time data. If not set, by default platform time will be updated at 1Hz using a `Handler` on the main thread.

### setStateStore

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

```
public @NonNull DynamicTypeEvaluator.Config.Builder setStateStore(@NonNull StateStore value)
```

Sets the state store that will be used for dereferencing the state keys in the dynamic types.

If not set, it's the equivalent of setting an empty state store (state bindings will trigger `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeValueReceiver#onInvalidated()`).