Option

class Option<T>

Defines available component (decoders, encoders, model loaders etc.) options with optional default values and the ability to affect the resource disk cache key used by RESOURCE.

Implementations must either be unique (usually declared as static final variables), or implement equals and hashCode.

Implementations can implement update to make sure that the disk cache key includes the specific option set.

Parameters

<T>

The type of the option (Integer, etc.), must implement equals and hashCode.

Types

Link copied to clipboard
interface CacheKeyUpdater<T>
An interface that updates a MessageDigest with the given value as part of a process to generate a disk cache key.

Functions

Link copied to clipboard
open fun <T> disk(key: String, cacheKeyUpdater: Option.CacheKeyUpdater<T>): Option<T>
Returns a new Option that uses the given to update disk cache keys.
open fun <T> disk(    key: String,     defaultValue: T,     cacheKeyUpdater: Option.CacheKeyUpdater<T>): Option<T>
Returns a new Option that uses the given to update disk cache keys and provides the given value as the default value.
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun <T> memory(key: String): Option<T>
Returns a new Option that does not affect disk cache keys with a null default value.
open fun <T> memory(key: String, defaultValue: T): Option<T>
Returns a new Option that does not affect disk cache keys with the given value as the default value.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun update(value: T, messageDigest: MessageDigest)
Updates the given MessageDigest used to construct a cache key with the given value using the com.bumptech.glide.load.Option.CacheKeyUpdater optionally provided in the constructor.

Properties

Link copied to clipboard
val defaultValue: T