Metadata
@UnstableApi
public final class Metadata
A collection of metadata entries.
Summary
Nested types |
|---|
public interface Metadata.EntryA metadata entry. |
Public fields |
|
|---|---|
final long |
The presentation time of the metadata, in microseconds. |
Public constructors |
|---|
Metadata(Metadata.Entry[] entries) |
Metadata(List<Metadata.Entry> entries) |
Metadata(long presentationTimeUs, Metadata.Entry[] entries) |
Metadata(long presentationTimeUs, List<Metadata.Entry> entries) |
Public methods |
|
|---|---|
Metadata |
copyWithAppendedEntries(Metadata.Entry[] entriesToAppend)Returns a copy of this metadata with the specified entries appended. |
Metadata |
Returns a copy of this metadata with the entries of the specified metadata appended. |
Metadata |
copyWithPresentationTimeUs(long presentationTimeUs)Returns a copy of this metadata with the specified presentation time. |
boolean |
|
Metadata.Entry |
get(int index)Returns the entry at the specified index. |
ImmutableList<T> |
<T extends Metadata.Entry> getEntriesOfType(Class<T> clazz)Returns the entries of type (or subtype of) |
@Nullable T |
<T extends Metadata.Entry> getFirstEntryOfType(Class<T> clazz)Returns the first entry of type (or subtype of) |
@Nullable T |
<T extends Metadata.Entry> getFirstMatchingEntry(Returns the first entry of type (or subtype of) |
ImmutableList<T> |
<T extends Metadata.Entry> getMatchingEntries(Returns the entries of type (or subtype of) |
int |
hashCode() |
int |
length()Returns the number of metadata entries. |
String |
toString() |
Public fields
presentationTimeUs
public final long presentationTimeUs
The presentation time of the metadata, in microseconds.
This time is an offset from the start of the current Timeline.Period.
This time is TIME_UNSET when not known or undefined.
Public constructors
Metadata
public Metadata(Metadata.Entry[] entries)
| Parameters | |
|---|---|
Metadata.Entry[] entries |
The metadata entries. |
Metadata
public Metadata(List<Metadata.Entry> entries)
| Parameters | |
|---|---|
List<Metadata.Entry> entries |
The metadata entries. |
Metadata
public Metadata(long presentationTimeUs, Metadata.Entry[] entries)
| Parameters | |
|---|---|
long presentationTimeUs |
The presentation time for the metadata entries. |
Metadata.Entry[] entries |
The metadata entries. |
Metadata
public Metadata(long presentationTimeUs, List<Metadata.Entry> entries)
| Parameters | |
|---|---|
long presentationTimeUs |
The presentation time for the metadata entries. |
List<Metadata.Entry> entries |
The metadata entries. |
Public methods
copyWithAppendedEntries
public Metadata copyWithAppendedEntries(Metadata.Entry[] entriesToAppend)
Returns a copy of this metadata with the specified entries appended.
| Parameters | |
|---|---|
Metadata.Entry[] entriesToAppend |
The entries to append. |
| Returns | |
|---|---|
Metadata |
The metadata instance with the appended entries. |
copyWithAppendedEntriesFrom
public Metadata copyWithAppendedEntriesFrom(@Nullable Metadata other)
Returns a copy of this metadata with the entries of the specified metadata appended. Returns this instance if other is null.
| Parameters | |
|---|---|
@Nullable Metadata other |
The metadata that holds the entries to append. If null, this methods returns this instance. |
| Returns | |
|---|---|
Metadata |
The metadata instance with the appended entries. |
copyWithPresentationTimeUs
public Metadata copyWithPresentationTimeUs(long presentationTimeUs)
Returns a copy of this metadata with the specified presentation time.
| Parameters | |
|---|---|
long presentationTimeUs |
The new presentation time, in microseconds. |
| Returns | |
|---|---|
Metadata |
The metadata instance with the new presentation time. |
get
public Metadata.Entry get(int index)
Returns the entry at the specified index.
| Parameters | |
|---|---|
int index |
The index of the entry. |
| Returns | |
|---|---|
Metadata.Entry |
The entry at the specified index. |
getEntriesOfType
public ImmutableList<T> <T extends Metadata.Entry> getEntriesOfType(Class<T> clazz)
Returns the entries of type (or subtype of) clazz.
getFirstEntryOfType
public @Nullable T <T extends Metadata.Entry> getFirstEntryOfType(Class<T> clazz)
Returns the first entry of type (or subtype of) clazz.
getFirstMatchingEntry
public @Nullable T <T extends Metadata.Entry> getFirstMatchingEntry(
Class<T> clazz,
Predicate<T> predicate
)
Returns the first entry of type (or subtype of) clazz that satisfies predicate.
getMatchingEntries
public ImmutableList<T> <T extends Metadata.Entry> getMatchingEntries(
Class<T> clazz,
Predicate<T> predicate
)
Returns the entries of type (or subtype of) clazz that satisfy predicate.