public interface

CacheKey

com.facebook.cache.common.CacheKey
Known Indirect Subclasses

Class Overview

Strongly typed cache key to be used instead of Object.

toString(), equals(Object) and hashCode() methods must be implemented.

Summary

Public Methods
abstract boolean containsUri(Uri uri)
Returns true if this key was constructed from this Uri.
abstract boolean equals(Object o)
This method must be implemented, otherwise the cache keys will be be compared by reference.
abstract String getUriString()
Returns a string representation of the URI at the heart of the cache key.
abstract int hashCode()
This method must be implemented with accordance to the equals(Object) method.
abstract boolean isResourceIdForDebugging()
Returns true if this key was constructed from a resource ID.
abstract String toString()
This is useful for instrumentation and debugging purposes.

Public Methods

public abstract 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 abstract boolean equals (Object o)

This method must be implemented, otherwise the cache keys will be be compared by reference.

public abstract 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 abstract int hashCode ()

This method must be implemented with accordance to the equals(Object) method.

public abstract 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 abstract String toString ()

This is useful for instrumentation and debugging purposes.