# ContentMetadataMutations

Artifact: [androidx.media3:media3-datasource](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/datasource/cache/ContentMetadataMutations.java+class:androidx.media3.datasource.cache.ContentMetadataMutations)

*** ** * ** ***


```
@UnstableApi
class ContentMetadataMutations
```

<br />

*** ** * ** ***

Defines multiple mutations on metadata value which are applied atomically. This class isn't thread safe.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#ContentMetadataMutations()()` Constructs a DefaultMetadataMutations. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#remove(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Adds a mutation to remove a metadata value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#set(java.lang.String,byte[])(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!)` Adds a mutation to set a metadata value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#set(java.lang.String,long)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Adds a mutation to set a metadata value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#set(java.lang.String,java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Adds a mutation to set a metadata value. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#setContentLength(androidx.media3.datasource.cache.ContentMetadataMutations,long)(mutations: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!, length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Adds a mutation to set the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_CONTENT_LENGTH()` value, or to remove any existing value if `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` is passed. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#setRedirectedUri(androidx.media3.datasource.cache.ContentMetadataMutations,android.net.Uri)(mutations: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!, uri: https://developer.android.com/reference/android/net/Uri.html?)` Adds a mutation to set the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_REDIRECTED_URI()` value, or to remove any existing entry if `null` is passed. |

| ### Public properties |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#editedValues()` |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations#removedValues()` |

## Public constructors

### ContentMetadataMutations

```
ContentMetadataMutations()
```

Constructs a DefaultMetadataMutations.

## Public functions

### remove

```
@CanIgnoreReturnValue
fun remove(name: String!): ContentMetadataMutations!
```

Adds a mutation to remove a metadata value.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the metadata value. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | This instance, for convenience. |

### set

```
@CanIgnoreReturnValue
fun set(name: String!, value: ByteArray<Byte>!): ContentMetadataMutations!
```

Adds a mutation to set a metadata value.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the metadata value. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | The value to be set. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | This instance, for convenience. |

### set

```
@CanIgnoreReturnValue
fun set(name: String!, value: Long): ContentMetadataMutations!
```

Adds a mutation to set a metadata value.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the metadata value. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The value to be set. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | This instance, for convenience. |

### set

```
@CanIgnoreReturnValue
fun set(name: String!, value: String!): ContentMetadataMutations!
```

Adds a mutation to set a metadata value.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the metadata value. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The value to be set. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | This instance, for convenience. |

### setContentLength

```
java-static fun setContentLength(mutations: ContentMetadataMutations!, length: Long): ContentMetadataMutations!
```

Adds a mutation to set the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_CONTENT_LENGTH()` value, or to remove any existing value if `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` is passed.

| Parameters |
|---|---|
| `mutations: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | The mutations to modify. |
| `length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The length value, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` to remove any existing entry. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | The mutations instance, for convenience. |

### setRedirectedUri

```
java-static fun setRedirectedUri(mutations: ContentMetadataMutations!, uri: Uri?): ContentMetadataMutations!
```

Adds a mutation to set the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_REDIRECTED_URI()` value, or to remove any existing entry if `null` is passed.

| Parameters |
|---|---|
| `mutations: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | The mutations to modify. |
| `uri: https://developer.android.com/reference/android/net/Uri.html?` | The `https://developer.android.com/reference/android/net/Uri.html` value, or `null` to remove any existing entry. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!` | The mutations instance, for convenience. |

## Public properties

### editedValues

```
val editedValues: (Mutable)Map<String!, Any!>!
```

### removedValues

```
val removedValues: (Mutable)List<String!>!
```