public class

MultiCacheKey

extends Object
implements CacheKey
java.lang.Object
   ↳ com.facebook.cache.common.MultiCacheKey

Class Overview

A cache key that wraps multiple cache keys.

Note: equals and hashcode are implemented in a way that two MultiCacheKeys are equal if and only if the underlying list of cache keys is equal. That implies AllOf semantics. Unfortunately, it is not possible to implement AnyOf semantics for equals because the transitivity requirement wouldn't be satisfied. I.e. we would have: {A} = {A, B}, {A, B} = {B}, but {A} != {B}.

It is fine to use this key with AnyOf semantics, but one should be aware of equals and hashcode behavior, and should implement AnyOf logic manually.

Summary

Public Constructors
MultiCacheKey(List<CacheKey> cacheKeys)
Public Methods
boolean containsUri(Uri uri)
Returns true if this key was constructed from this Uri.
boolean equals(Object o)
List<CacheKey> getCacheKeys()
String getUriString()
Returns a string representation of the URI at the heart of the cache key.
int hashCode()
boolean isResourceIdForDebugging()
Returns true if this key was constructed from a resource ID.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.cache.common.CacheKey

Public Constructors

public MultiCacheKey (List<CacheKey> cacheKeys)

Public Methods

public boolean containsUri (Uri uri)

Returns true if this key was constructed from this Uri.

Used for cases like deleting all keys for a given uri.

public boolean equals (Object o)

public List<CacheKey> getCacheKeys ()

public String getUriString ()

Returns a string representation of the URI at the heart of the cache key. In cases of multiple keys being contained, the first is returned.

public int hashCode ()

public boolean isResourceIdForDebugging ()

Returns true if this key was constructed from a resource ID. If this ever changes, the disk cache entries corresponding to this cache key would be invalidated.

public String toString ()