Added in API level 30

AudioMetadataMap


interface AudioMetadataMap : AudioMetadataReadMap

AudioMetadataMap is a writeable Map-style interface of AudioMetadata.Key value pairs. This interface is not guaranteed to be thread-safe unless the underlying implementation for the AudioMetadataMap states it as thread safe. {@see AudioMetadataReadMap}

Summary

Public methods
abstract T?

Removes the value associated with the key.

abstract T?
set(key: AudioMetadata.Key<T>, value: T)

Sets a value for the key.

Inherited functions
Boolean containsKey(key: AudioMetadata.Key<T>)

Returns true if the key exists in the map.

AudioMetadataMap dup()

Returns a copy of the map. This is intended for safe conversion between a AudioMetadataReadMap interface and a AudioMetadataMap interface. Currently only simple objects are used for key values which means a shallow copy is sufficient.

T? get(key: AudioMetadata.Key<T>)

Returns the value associated with the key.

Int size()

Returns the number of elements in the map.

Public methods

remove

Added in API level 30
abstract fun <T : Any!> remove(key: AudioMetadata.Key<T>): T?

Removes the value associated with the key.

Parameters
key AudioMetadata.Key<T>: interface for storing the value. This value cannot be null.
<T> type of value.
Return
T? the value of the key, null if it doesn't exist.

set

Added in API level 30
abstract fun <T : Any!> set(
    key: AudioMetadata.Key<T>,
    value: T
): T?

Sets a value for the key.

Parameters
key AudioMetadata.Key<T>: interface for storing the value. This value cannot be null.
<T> type of value.
value T: a non-null value of type T.
Return
T? the previous value associated with key or null if it doesn't exist.