com.bumptech.glide.signature
Class MediaStoreSignature

java.lang.Object
  extended by com.bumptech.glide.signature.MediaStoreSignature
All Implemented Interfaces:
Key

public class MediaStoreSignature
extends Object
implements Key

A unique signature based on metadata data from the media store that detects common changes to media store files like edits, rotations, and temporary file replacement.


Field Summary
 
Fields inherited from interface com.bumptech.glide.load.Key
STRING_CHARSET_NAME
 
Constructor Summary
MediaStoreSignature(String mimeType, long dateModified, int orientation)
          Constructor for MediaStoreSignature.
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 void updateDiskCacheKey(MessageDigest messageDigest)
          Adds all uniquely identifying information to the given digest.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaStoreSignature

public MediaStoreSignature(String mimeType,
                           long dateModified,
                           int orientation)
Constructor for MediaStoreSignature.

Parameters:
mimeType - The mime type of the media store media. Ok to default to empty string "". See MediaStore.MediaColumns.MIME_TYPE or MediaStore.MediaColumns.MIME_TYPE.
dateModified - The date modified time of the media store media. Ok to default to 0. See MediaStore.MediaColumns.DATE_MODIFIED or MediaStore.MediaColumns.DATE_MODIFIED.
orientation - The orientation of the media store media. Ok to default to 0. See MediaStore.Images.ImageColumns.ORIENTATION.
Method Detail

equals

public boolean equals(Object o)
Specified by:
equals in interface Key
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Key
Overrides:
hashCode in class Object

updateDiskCacheKey

public void updateDiskCacheKey(MessageDigest messageDigest)
                        throws UnsupportedEncodingException
Description copied from interface: Key
Adds all uniquely identifying information to the given digest.

Note - Using MessageDigest.reset() inside of this method will result in undefined behavior.

Specified by:
updateDiskCacheKey in interface Key
Throws:
UnsupportedEncodingException