Package com.google.android.exoplayer2.upstream.cache

## Class DefaultContentMetadata

- java.lang.Object
- - com.google.android.exoplayer2.upstream.cache.DefaultContentMetadata

- All Implemented Interfaces:
    `ContentMetadata`

      public final class DefaultContentMetadata
      extends Object
      implements ContentMetadata

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

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static DefaultContentMetadata` | `EMPTY` | An empty DefaultContentMetadata.

    - ### Fields inherited from interface com.google.android.exoplayer2.upstream.cache.ContentMetadata

      `KEY_CONTENT_LENGTH, KEY_CUSTOM_PREFIX, KEY_REDIRECTED_URI`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultContentMetadata()` |
    `DefaultContentMetadata​(Map<String,​byte[]> metadata)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `contains​(String key)` | Returns whether the metadata is available.
    `DefaultContentMetadata` | `copyWithMutationsApplied​(ContentMetadataMutations mutations)` | Returns a copy `DefaultContentMetadata` with `mutations` applied.
    `Set<Map.Entry<String,​byte[]>>` | `entrySet()` | Returns the set of metadata entries in their raw byte array form.
    `boolean` | `equals​(Object o)` |
    `byte[]` | `get​(String key, byte[] defaultValue)` | Returns a metadata value.
    `long` | `get​(String key, long defaultValue)` | Returns a metadata value.
    `String` | `get​(String key, String defaultValue)` | Returns a metadata value.
    `int` | `hashCode()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY

          public static final DefaultContentMetadata EMPTY

      An empty DefaultContentMetadata.

  - ### Constructor Detail

    - #### DefaultContentMetadata

          public DefaultContentMetadata()

    - #### DefaultContentMetadata

          public DefaultContentMetadata​(Map<String,​byte[]> metadata)

      Parameters:
        `metadata` - The metadata entries in their raw byte array form.

  - ### Method Detail

    - #### copyWithMutationsApplied

          public DefaultContentMetadata copyWithMutationsApplied​(ContentMetadataMutations mutations)

      Returns a copy `DefaultContentMetadata` with `mutations` applied. If `mutations` don't change anything, returns this instance.

    - #### entrySet

          public Set<Map.Entry<String,​byte[]>> entrySet()

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

    - #### get

          @Nullable
          public final byte[] get​(String key,
                                  @Nullable
                                  byte[] defaultValue)

      Description copied from interface: `ContentMetadata`
      Returns a metadata value.
      Specified by:
        `get` in interface `ContentMetadata`
      Parameters:
        `key` - Key of the metadata to be returned.
        `defaultValue` - Value to return if the metadata doesn't exist.
      Returns:
        The metadata value.

    - #### get

          @Nullable
          public final String get​(String key,
                                  @Nullable
                                  String defaultValue)

      Description copied from interface: `ContentMetadata`
      Returns a metadata value.
      Specified by:
        `get` in interface `ContentMetadata`
      Parameters:
        `key` - Key of the metadata to be returned.
        `defaultValue` - Value to return if the metadata doesn't exist.
      Returns:
        The metadata value.

    - #### get

          public final long get​(String key,
                                long defaultValue)

      Description copied from interface: `ContentMetadata`
      Returns a metadata value.
      Specified by:
        `get` in interface `ContentMetadata`
      Parameters:
        `key` - Key of the metadata to be returned.
        `defaultValue` - Value to return if the metadata doesn't exist.
      Returns:
        The metadata value.

    - #### contains

          public final boolean contains​(String key)

      Description copied from interface: `ContentMetadata`
      Returns whether the metadata is available.
      Specified by:
        `contains` in interface `ContentMetadata`

    - #### equals

          public boolean equals​(@Nullable
                                Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`