Rename Cache getContentMetadataSnapshot to getContentMetadata

And in ContentMetadata javadoc emphasize that it's a snapshot.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190461436
This commit is contained in:
eguven 2018-03-26 07:26:27 -07:00 committed by Oliver Woodman
parent eb84b144bf
commit 2a85e792f8
4 changed files with 8 additions and 8 deletions

View File

@ -257,10 +257,10 @@ public interface Cache {
throws CacheException; throws CacheException;
/** /**
* Returns a snapshot of the {@link ContentMetadata} for the given key. * Returns a {@link ContentMetadata} for the given key.
* *
* @param key The cache key for the data. * @param key The cache key for the data.
* @return A snapshot of the {@link ContentMetadata} for the given key. * @return A {@link ContentMetadata} for the given key.
*/ */
ContentMetadata getContentMetadataSnapshot(String key); ContentMetadata getContentMetadata(String key);
} }

View File

@ -227,8 +227,8 @@ import javax.crypto.spec.SecretKeySpec;
cachedContent.applyMetadataMutations(mutations); cachedContent.applyMetadataMutations(mutations);
} }
/** Returns a snapshot of the {@link ContentMetadata} for the given key. */ /** Returns a {@link ContentMetadata} for the given key. */
public ContentMetadata getContentMetadataSnapshot(String key) { public ContentMetadata getContentMetadata(String key) {
CachedContent cachedContent = get(key); CachedContent cachedContent = get(key);
return cachedContent != null ? cachedContent.getMetadata() : DefaultContentMetadata.EMPTY; return cachedContent != null ? cachedContent.getMetadata() : DefaultContentMetadata.EMPTY;
} }

View File

@ -15,7 +15,7 @@
*/ */
package com.google.android.exoplayer2.upstream.cache; package com.google.android.exoplayer2.upstream.cache;
/** Interface for accessing cached content metadata which is stored as name, value pairs. */ /** Interface for an immutable snapshot of keyed metadata. */
public interface ContentMetadata { public interface ContentMetadata {
/** /**

View File

@ -466,7 +466,7 @@ public final class SimpleCache implements Cache {
} }
@Override @Override
public ContentMetadata getContentMetadataSnapshot(String key) { public ContentMetadata getContentMetadata(String key) {
return index.getContentMetadataSnapshot(key); return index.getContentMetadata(key);
} }
} }