Package com.bumptech.glide.signature
Class ObjectKey
- java.lang.Object
-
- com.bumptech.glide.signature.ObjectKey
-
- All Implemented Interfaces:
Key
public final class ObjectKey extends java.lang.Object implements Key
Wraps anObject, delegatingequals(Object)andhashCode()to the wrapped Object and providing the bytes of the result of the Object'stoString()method to theMessageDigestinupdateDiskCacheKey(java.security.MessageDigest).The Object's
toString()method must be unique and suitable for use as a disk cache key.
-
-
Field Summary
-
Fields inherited from interface com.bumptech.glide.load.Key
CHARSET, STRING_CHARSET_NAME
-
-
Constructor Summary
Constructors Constructor Description ObjectKey(java.lang.Object object)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)For caching to work correctly, implementations must implement this method andKey.hashCode().inthashCode()For caching to work correctly, implementations must implement this method andKey.equals(Object).java.lang.StringtoString()voidupdateDiskCacheKey(java.security.MessageDigest messageDigest)Adds all uniquely identifying information to the given digest.
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:KeyFor caching to work correctly, implementations must implement this method andKey.hashCode().
-
hashCode
public int hashCode()
Description copied from interface:KeyFor caching to work correctly, implementations must implement this method andKey.equals(Object).
-
updateDiskCacheKey
public void updateDiskCacheKey(@NonNull java.security.MessageDigest messageDigest)Description copied from interface:KeyAdds all uniquely identifying information to the given digest.Note - Using
MessageDigest.reset()inside of this method will result in undefined behavior.- Specified by:
updateDiskCacheKeyin interfaceKey
-
-