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

## Interface CacheKeyFactory

-     public interface CacheKeyFactory

  Factory for cache keys.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static CacheKeyFactory` | `DEFAULT` | Default `CacheKeyFactory`.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `buildCacheKey​(DataSpec dataSpec)` | Returns the cache key of the resource containing the data defined by a `DataSpec`.

- - ### Field Detail

    - #### DEFAULT

          static final CacheKeyFactory DEFAULT

      Default `CacheKeyFactory`.

  - ### Method Detail

    - #### buildCacheKey

          String buildCacheKey​(DataSpec dataSpec)

      Returns the cache key of the resource containing the data defined by a `DataSpec`.

      Note that since the returned cache key corresponds to the whole resource, implementations must not return different cache keys for `DataSpecs` that define different ranges of the same resource. As a result, implementations should not use fields such as `DataSpec.position` and `DataSpec.length`.

      Parameters:
        `dataSpec` - The `DataSpec`.
      Returns:
        The cache key of the resource.