Class MediaStoreSignature

  • All Implemented Interfaces:
    Key

    public class MediaStoreSignature
    extends java.lang.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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      For caching to work correctly, implementations must implement this method and Key.hashCode().
      int hashCode()
      For caching to work correctly, implementations must implement this method and Key.equals(Object).
      void updateDiskCacheKey​(java.security.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​(@Nullable
                                   java.lang.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.MediaColumns.ORIENTATION.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from interface: Key
        For caching to work correctly, implementations must implement this method and Key.hashCode().
        Specified by:
        equals in interface Key
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Description copied from interface: Key
        For caching to work correctly, implementations must implement this method and Key.equals(Object).
        Specified by:
        hashCode in interface Key
        Overrides:
        hashCode in class java.lang.Object
      • updateDiskCacheKey

        public void updateDiskCacheKey​(@NonNull
                                       java.security.MessageDigest messageDigest)
        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