Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/media/AudioMetadataMap#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/AudioMetadataMap#inhmethods)

# AudioMetadataMap

*** ** * ** ***


`
public


interface
AudioMetadataMap
`


`


implements

https://developer.android.com/reference/android/media/AudioMetadataReadMap


`

|---|
| android.media.AudioMetadataMap |

<br />

*** ** * ** ***

AudioMetadataMap is a writeable `Map`-style
interface of `https://developer.android.com/reference/android/media/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 also:**

- `https://developer.android.com/reference/android/media/AudioMetadataReadMap`

## Summary

| ### Public methods ||
|---|---|
| ` abstract <T> T` | ` https://developer.android.com/reference/android/media/AudioMetadataMap#remove(android.media.AudioMetadata.Key<T>)(https://developer.android.com/reference/android/media/AudioMetadata.Key<T> key) ` Removes the value associated with the key. |
| ` abstract <T> T` | ` https://developer.android.com/reference/android/media/AudioMetadataMap#set(android.media.AudioMetadata.Key<T>,%20T)(https://developer.android.com/reference/android/media/AudioMetadata.Key<T> key, T value) ` Sets a value for the key. |

| ### Inherited methods |
|---|---|
| From interface ` https://developer.android.com/reference/android/media/AudioMetadataReadMap ` |---|---| | ` abstract <T> boolean` | ` https://developer.android.com/reference/android/media/AudioMetadataReadMap#containsKey(android.media.AudioMetadata.Key<T>)(https://developer.android.com/reference/android/media/AudioMetadata.Key<T> key) ` Returns true if the key exists in the map. | | ` abstract https://developer.android.com/reference/android/media/AudioMetadataMap` | ` https://developer.android.com/reference/android/media/AudioMetadataReadMap#dup()() ` Returns a copy of the map. | | ` abstract <T> T` | ` https://developer.android.com/reference/android/media/AudioMetadataReadMap#get(android.media.AudioMetadata.Key<T>)(https://developer.android.com/reference/android/media/AudioMetadata.Key<T> key) ` Returns the value associated with the key. | | ` abstract int` | ` https://developer.android.com/reference/android/media/AudioMetadataReadMap#size()() ` Returns the number of elements in the map. | ||

## Public methods

### remove

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract T remove (Key<T> key)
```

Removes the value associated with the key.

<br />

| Parameters ||
|---|---|
| `key` | `Key`: interface for storing the value. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | the value of the key, null if it doesn't exist. <br /> |

### set

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract T set (Key<T> key, 
                T value)
```

Sets a value for the key.

<br />

| Parameters ||
|---|---|
| `key` | `Key`: interface for storing the value. This value cannot be `null`. <br /> |
| `value` | `T`: a non-null value of type T. <br /> |

| Returns ||
|---|---|
| `T` | the previous value associated with key or null if it doesn't exist. <br /> |