T
- The type of the option.public static interface Option.CacheKeyUpdater<T>
MessageDigest
with the given value as part of a process to
generate a disk cache key.Modifier and Type | Method and Description |
---|---|
void |
update(byte[] keyBytes,
T value,
MessageDigest messageDigest)
Updates the given
MessageDigest with the bytes of the given key (to avoid incidental
value collisions when values are not particularly unique) and value. |
void update(@NonNull byte[] keyBytes, @NonNull T value, @NonNull MessageDigest messageDigest)
MessageDigest
with the bytes of the given key (to avoid incidental
value collisions when values are not particularly unique) and value.
If your Option
shouldn't affect the disk cache key, you should not implement this
class and use Option.memory(String)
or Option.memory(String, Object)
instead.
keyBytes
- The bytes of the String
used as the key for this particular
Option
. Should be added to the messageDigest
using
MessageDigest.update(byte[])
by all implementations if the digest is updated with
the given value
parameter.value
- The value of of this particular option. Typically you should convert the value
to a byte array using some stable mechanism and then call
MessageDigest.update(byte[])
to update the given digest.