DefaultContentMetadata


@UnstableApi
class DefaultContentMetadata : ContentMetadata


Default implementation of ContentMetadata. Values are stored as byte arrays.

Summary

Constants

const DefaultContentMetadata!

An empty DefaultContentMetadata.

Public constructors

Public functions

Boolean

Returns whether the metadata is available.

DefaultContentMetadata!

Returns a copy DefaultContentMetadata with mutations applied.

(Mutable)Set<(Mutable)Map.Entry<String!, ByteArray<Byte>!>!>!

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

Boolean
equals(o: Any?)
ByteArray<Byte>?
get(key: String!, defaultValue: ByteArray?)

Returns a metadata value.

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

Returns a metadata value.

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

Returns a metadata value.

Int

Inherited Constants

From androidx.media3.datasource.cache.ContentMetadata
const String!
KEY_CONTENT_LENGTH = "exo_len"

Key for content length in bytes (type: long).

const String!
KEY_CUSTOM_PREFIX = "custom_"

Prefix for custom metadata keys.

const String!
KEY_REDIRECTED_URI = "exo_redir"

Key for redirected uri (type: String).

Inherited functions

From androidx.media3.datasource.cache.ContentMetadata
java-static Long
getContentLength(contentMetadata: ContentMetadata!)

Returns the value stored under KEY_CONTENT_LENGTH, or LENGTH_UNSET if not set.

java-static Uri?
getRedirectedUri(contentMetadata: ContentMetadata!)

Returns the value stored under KEY_REDIRECTED_URI as a Uri, or {code null} if not set.

Constants

EMPTY

const val EMPTYDefaultContentMetadata!

An empty DefaultContentMetadata.

Public constructors

DefaultContentMetadata

DefaultContentMetadata()

DefaultContentMetadata

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

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 DefaultContentMetadata with mutations applied. If mutations don't change anything, returns this instance.

entrySet

fun entrySet(): (Mutable)Set<(Mutable)Map.Entry<String!, ByteArray<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?): ByteArray<Byte>?

Returns a metadata value.

Parameters
key: String!

Key of the metadata to be returned.

defaultValue: ByteArray?

Value to return if the metadata doesn't exist.

Returns
ByteArray<Byte>?

The metadata value.

get

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

Returns a metadata value.

Parameters
key: String!

Key of the metadata to be returned.

defaultValue: Long

Value to return if the metadata doesn't exist.

Returns
Long

The metadata value.

get

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

Returns a metadata value.

Parameters
key: String!

Key of the metadata to be returned.

defaultValue: String?

Value to return if the metadata doesn't exist.

Returns
String?

The metadata value.

hashCode

fun hashCode(): Int