# DataKt

Added in 2.9.0

*** ** * ** ***


```
public final class DataKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final boolean` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/work/DataKt#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/Data receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html key)` Returns true if the instance of `https://developer.android.com/reference/androidx/work/Data` has a value corresponding to the given `https://developer.android.com/reference/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)` with an expected type `https://developer.android.com/reference/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/Data` | `https://developer.android.com/reference/androidx/work/DataKt#workDataOf(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html>... pairs)` Converts a list of pairs to a `https://developer.android.com/reference/androidx/work/Data` object. |

## Public methods

### hasKeyWithValueOfType

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/Data.kt+function:hasKeyWithValueOfType)

```
public static final boolean <T extends Object> hasKeyWithValueOfType(@NonNull Data receiver, @NonNull String key)
```

Returns true if the instance of `https://developer.android.com/reference/androidx/work/Data` has a value corresponding to the given `https://developer.android.com/reference/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)` with an expected type `https://developer.android.com/reference/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)`.

### workDataOf

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/Data.kt+function:workDataOf)

```
public static final @NonNull Data workDataOf(@NonNull Pair<@NonNull String, Object>... pairs)
```

Converts a list of pairs to a `https://developer.android.com/reference/androidx/work/Data` object.

If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.

Entries of the map are iterated in the order they were specified.