Package com.bumptech.glide.load
Interface Option.CacheKeyUpdater<T>
- Type Parameters:
T- The type of the option.
public static interface Option.CacheKeyUpdater<T>
An interface that updates a
MessageDigest with the given value as part of a process to
generate a disk cache key.-
Method Summary
Modifier and TypeMethodDescriptionvoidupdate(byte[] keyBytes, T value, MessageDigest messageDigest) Updates the givenMessageDigestwith the bytes of the given key (to avoid incidental value collisions when values are not particularly unique) and value.
-
Method Details
-
update
Updates the givenMessageDigestwith the bytes of the given key (to avoid incidental value collisions when values are not particularly unique) and value.If your
Optionshouldn't affect the disk cache key, you should not implement this class and useOption.memory(String)orOption.memory(String, Object)instead.- Parameters:
keyBytes- The bytes of theStringused as the key for this particularOption. Should be added to themessageDigestusingMessageDigest.update(byte[])by all implementations if the digest is updated with the givenvalueparameter.value- The value of of this particular option. Typically you should convert the value to a byte array using some stable mechanism and then callMessageDigest.update(byte[])to update the given digest.
-