# Metadata

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

*** ** * ** ***

<br />

```
@UnstableApi
class Metadata
```

<br />

*** ** * ** ***

A collection of metadata entries.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry` A metadata entry. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#Metadata(androidx.media3.common.Metadata.Entry...)(entries: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!)` |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#Metadata(java.util.List<? extends androidx.media3.common.Metadata.Entry>)(entries: (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://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!)` |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#Metadata(long,androidx.media3.common.Metadata.Entry...)(presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, entries: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!)` |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#Metadata(long,java.util.List<? extends androidx.media3.common.Metadata.Entry>)( presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, entries: (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://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>! )` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#copyWithAppendedEntries(androidx.media3.common.Metadata.Entry...)(entriesToAppend: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!)` Returns a copy of this metadata with the specified entries appended. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#copyWithAppendedEntriesFrom(androidx.media3.common.Metadata)(other: https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata?)` Returns a copy of this metadata with the entries of the specified metadata appended. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#copyWithPresentationTimeUs(long)(presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns a copy of this metadata with the specified presentation time. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#get(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the entry at the specified index. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<T!>!` | `<T : https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry?> https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#getEntriesOfType(java.lang.Class<T>)(clazz: https://developer.android.com/reference/java/lang/Class.html<T!>!)` Returns the entries of type (or subtype of) `clazz`. |
| `T?` | `<T : https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry?> https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#getFirstEntryOfType(java.lang.Class<T>)(clazz: https://developer.android.com/reference/java/lang/Class.html<T!>!)` Returns the first entry of type (or subtype of) `clazz`. |
| `T?` | `<T : https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry?> https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#getFirstMatchingEntry(java.lang.Class<T>,com.google.common.base.Predicate<T>)( clazz: https://developer.android.com/reference/java/lang/Class.html<T!>!, predicate: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Predicate.html<T!>! )` Returns the first entry of type (or subtype of) `clazz` that satisfies `predicate`. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<T!>!` | `<T : https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry?> https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#getMatchingEntries(java.lang.Class<T>,com.google.common.base.Predicate<T>)( clazz: https://developer.android.com/reference/java/lang/Class.html<T!>!, predicate: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Predicate.html<T!>! )` Returns the entries of type (or subtype of) `clazz` that satisfy `predicate`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#length()()` Returns the number of metadata entries. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata#presentationTimeUs()` The presentation time of the metadata, in microseconds. |

## Public constructors

### Metadata

```
Metadata(entries: Array<Metadata.Entry!>!)
```

| Parameters |
|---|---|
| `entries: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!` | The metadata entries. |

### Metadata

```
Metadata(entries: (Mutable)List<Metadata.Entry!>!)
```

| Parameters |
|---|---|
| `entries: (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://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!` | The metadata entries. |

### Metadata

```
Metadata(presentationTimeUs: Long, entries: Array<Metadata.Entry!>!)
```

| Parameters |
|---|---|
| `presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation time for the metadata entries. |
| `entries: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!` | The metadata entries. |

### Metadata

```
Metadata(
    presentationTimeUs: Long,
    entries: (Mutable)List<Metadata.Entry!>!
)
```

| Parameters |
|---|---|
| `presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation time for the metadata entries. |
| `entries: (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://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!` | The metadata entries. |

## Public functions

### copyWithAppendedEntries

```
fun copyWithAppendedEntries(entriesToAppend: Array<Metadata.Entry!>!): Metadata!
```

Returns a copy of this metadata with the specified entries appended.

| Parameters |
|---|---|
| `entriesToAppend: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!>!` | The entries to append. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata!` | The metadata instance with the appended entries. |

### copyWithAppendedEntriesFrom

```
fun copyWithAppendedEntriesFrom(other: Metadata?): Metadata!
```

Returns a copy of this metadata with the entries of the specified metadata appended. Returns this instance if `other` is null.

| Parameters |
|---|---|
| `other: https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata?` | The metadata that holds the entries to append. If null, this methods returns this instance. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata!` | The metadata instance with the appended entries. |

### copyWithPresentationTimeUs

```
fun copyWithPresentationTimeUs(presentationTimeUs: Long): Metadata!
```

Returns a copy of this metadata with the specified presentation time.

| Parameters |
|---|---|
| `presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The new presentation time, in microseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata!` | The metadata instance with the new presentation time. |

### equals

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

### get

```
fun get(index: Int): Metadata.Entry!
```

Returns the entry at the specified index.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the entry. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata.Entry!` | The entry at the specified index. |

### getEntriesOfType

```
fun <T : Metadata.Entry?> getEntriesOfType(clazz: Class<T!>!): ImmutableList<T!>!
```

Returns the entries of type (or subtype of) `clazz`.

### getFirstEntryOfType

```
fun <T : Metadata.Entry?> getFirstEntryOfType(clazz: Class<T!>!): T?
```

Returns the first entry of type (or subtype of) `clazz`.

### getFirstMatchingEntry

```
fun <T : Metadata.Entry?> getFirstMatchingEntry(
    clazz: Class<T!>!,
    predicate: Predicate<T!>!
): T?
```

Returns the first entry of type (or subtype of) `clazz` that satisfies `predicate`.

### getMatchingEntries

```
fun <T : Metadata.Entry?> getMatchingEntries(
    clazz: Class<T!>!,
    predicate: Predicate<T!>!
): ImmutableList<T!>!
```

Returns the entries of type (or subtype of) `clazz` that satisfy `predicate`.

### hashCode

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

### length

```
fun length(): Int
```

Returns the number of metadata entries.

### toString

```
fun toString(): String!
```

## Public properties

### presentationTimeUs

```
val presentationTimeUs: Long
```

The presentation time of the metadata, in microseconds.

This time is an offset from the start of the current `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline.Period`.

This time is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` when not known or undefined.