# PlatformDataKey

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

*** ** * ** ***


```
public final class PlatformDataKey<T extends DynamicBuilders.DynamicType> extends DynamicDataKey<T>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.wear.protolayout.expression.DynamicDataKey](https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey)\<T\> ||
|   | ↳ | [androidx.wear.protolayout.expression.PlatformDataKey](https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey) |

*** ** * ** ***

Represent a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey` that references real-time data from the platform.

The \[namespace, key\] tuple creates the actual reference, so that a single key can refer to two different sources in two different namespaces.

The namespace must not be empty. Additionally, the "protolayout" namespace (and its lowercase and uppercase variations) are reserved for the default platform data sources and should not be used for any custom OEM data source. To make sure namespaces are unique, any custom namespace is expected to follow Java style naming `com.company.foo`.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicType>` | The data type of the dynamic values that this key is bound to. |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey#PlatformDataKey(java.lang.String,java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html key)` Create a `https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey` with the specified key in the given namespace. |

### Inherited fields

From [androidx.wear.protolayout.expression.DynamicDataKey](https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey) `final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#key()` `final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#namespace()`

### Inherited methods

From [androidx.wear.protolayout.expression.DynamicDataKey](https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey) `boolean` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html other)` `final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#getKey()()` `final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#getNamespace()()` `int` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#hashCode()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey#toString()()`

## Public constructors

### PlatformDataKey

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

```
public PlatformDataKey(@NonNull String namespace, @NonNull String key)
```

Create a `https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey` with the specified key in the given namespace.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | The namespace of the key for the platform data source. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html key` | The key that references the platform data source. |