# AudioMetadataReadMap

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/AudioMetadataReadMap#pubmethods)  

# AudioMetadataReadMap

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/AudioMetadataReadMap "View this page in Kotlin")\|Java

`
public


interface
AudioMetadataReadMap
`  
`


`

|------------------------------------|
| android.media.AudioMetadataReadMap |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [AudioMetadataMap](https://developer.android.com/reference/android/media/AudioMetadataMap) |--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AudioMetadataMap](https://developer.android.com/reference/android/media/AudioMetadataMap) | AudioMetadataMap is a writeable`Map`-style interface of[AudioMetadata.Key](https://developer.android.com/reference/android/media/AudioMetadata.Key)value pairs. | |

<br />

*** ** * ** ***

A read only`Map`-style interface of[AudioMetadata.Key](https://developer.android.com/reference/android/media/AudioMetadata.Key)value pairs used for[AudioMetadata](https://developer.android.com/reference/android/media/AudioMetadata).

Using a[AudioMetadata.Key](https://developer.android.com/reference/android/media/AudioMetadata.Key)interface, this map looks up the corresponding value. Read-only maps are thread-safe for lookup, but the underlying object values may need their own thread protection if mutable.

<br />

**See also:**

- [AudioMetadataMap](https://developer.android.com/reference/android/media/AudioMetadataMap)

## Summary

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

## Public methods

### containsKey

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

```
public abstract boolean containsKey (Key<T> key)
```

Returns true if the key exists in the map.

<br />

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

|                     Returns                      ||
|-----------|---------------------------------------|
| `boolean` | true if key exists in the Map. <br /> |

### dup

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

```
public abstract AudioMetadataMap dup ()
```

Returns a copy of the map. This is intended for safe conversion between a[AudioMetadataReadMap](https://developer.android.com/reference/android/media/AudioMetadataReadMap)interface and a[AudioMetadataMap](https://developer.android.com/reference/android/media/AudioMetadataMap)interface. Currently only simple objects are used for key values which means a shallow copy is sufficient.

<br />

|                                                                              Returns                                                                               ||
|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [AudioMetadataMap](https://developer.android.com/reference/android/media/AudioMetadataMap) | a Map copied from the existing map. This value cannot be`null`. <br /> |

### get

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

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

Returns the value associated with the key.

<br />

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

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

### size

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

```
public abstract int size ()
```

Returns the number of elements in the map.

<br />

|               Returns               ||
|-------|------------------------------|
| `int` | Value is 0 or greater <br /> |