# DefaultContentMetadata

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/DefaultContentMetadata.java+class:androidx.media3.datasource.cache.DefaultContentMetadata)

*** ** * ** ***

<br />

```
@UnstableApi
class DefaultContentMetadata : ContentMetadata
```

<br />

*** ** * ** ***

Default implementation of `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata`. Values are stored as byte arrays.

## Summary

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#EMPTY()` An empty DefaultContentMetadata. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#DefaultContentMetadata()()` |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#DefaultContentMetadata(java.util.Map<java.lang.String,byte[]>)(metadata: (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/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!>!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#contains(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns whether the metadata is available. |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#copyWithMutationsApplied(androidx.media3.datasource.cache.ContentMetadataMutations)(mutations: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadataMutations!)` Returns a copy `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata` with `mutations` applied. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/-mutable-entry/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/-entry/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!>!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#entrySet()()` Returns the set of metadata entries in their raw byte array form. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#get(java.lang.String,byte[])(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, defaultValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>?)` Returns a metadata value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#get(java.lang.String,long)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, defaultValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns a metadata value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#get(java.lang.String,java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, defaultValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Returns a metadata value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata#hashCode()()` |

### Inherited Constants

From [androidx.media3.datasource.cache.ContentMetadata](https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_CONTENT_LENGTH() = "exo_len"`

Key for content length in bytes (type: long).
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_CUSTOM_PREFIX() = "custom_"`

Prefix for custom metadata keys.
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_REDIRECTED_URI() = "exo_redir"`

Key for redirected uri (type: String).

### Inherited functions

From [androidx.media3.datasource.cache.ContentMetadata](https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata) `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#getContentLength(androidx.media3.datasource.cache.ContentMetadata)(contentMetadata: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata!)`

Returns the value stored under `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_CONTENT_LENGTH()`, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if not set.
`java-static https://developer.android.com/reference/android/net/Uri.html?` `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#getRedirectedUri(androidx.media3.datasource.cache.ContentMetadata)(contentMetadata: https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata!)`

Returns the value stored under `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/ContentMetadata#KEY_REDIRECTED_URI()` as a `https://developer.android.com/reference/android/net/Uri.html`, or {code null} if not set.

## Constants

### EMPTY

```
const val EMPTY: DefaultContentMetadata!
```

An empty DefaultContentMetadata.

## Public constructors

### DefaultContentMetadata

```
DefaultContentMetadata()
```

### DefaultContentMetadata

```
DefaultContentMetadata(metadata: (Mutable)Map<String!, ByteArray<Byte>!>!)
```

| Parameters |
|---|---|
| `metadata: (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/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!>!` | The metadata entries in their raw byte array form. |

## Public functions

### contains

```
fun contains(key: String!): Boolean
```

Returns whether the metadata is available.

### copyWithMutationsApplied

```
fun copyWithMutationsApplied(mutations: ContentMetadataMutations!): DefaultContentMetadata!
```

Returns a copy `https://developer.android.com/reference/kotlin/androidx/media3/datasource/cache/DefaultContentMetadata` with `mutations` applied. If ` mutations` don't change anything, returns this instance.

### entrySet

```
fun entrySet(): (Mutable)Set<(Mutable)Map.Entry<String!, Array<Byte>!>!>!
```

Returns the set of metadata entries in their raw byte array form.

### equals

```
fun equals(o: Any?): Boolean
```

### get

```
fun get(key: String!, defaultValue: ByteArray<Byte>?): Array<Byte>?
```

Returns a metadata value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | Key of the metadata to be returned. |
| `defaultValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>?` | Value to return if the metadata doesn't exist. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>?` | The metadata value. |

### get

```
fun get(key: String!, defaultValue: Long): Long
```

Returns a metadata value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | Key of the metadata to be returned. |
| `defaultValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | Value to return if the metadata doesn't exist. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The metadata value. |

### get

```
fun get(key: String!, defaultValue: String?): String?
```

Returns a metadata value.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | Key of the metadata to be returned. |
| `defaultValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | Value to return if the metadata doesn't exist. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The metadata value. |

### hashCode

```
fun hashCode(): Int
```