@Deprecated public abstract class Reference<L> extends Object
ReferenceLifecycle
subclass. Use acquire(Context, Reference)
to acquire the
underlying resource and release(Context, Object, Reference)
to release it when
it's not needed anymore.Modifier and Type | Class and Description |
---|---|
static class |
Reference.Builder<L>
Deprecated.
|
Modifier | Constructor and Description |
---|---|
protected |
Reference(ReferenceLifecycle<L> lifecycle)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
acquire(Context context,
Reference<T> reference)
Deprecated.
Acquires a Reference of type T.
|
abstract String |
getSimpleName()
Deprecated.
|
static <T> void |
release(Context context,
T value,
Reference<T> reference)
Deprecated.
Releases the object previously acquired by calling
acquire(Context,
Reference) . |
static boolean |
shouldUpdate(Reference previous,
Reference next)
Deprecated.
Checks whether acquiring object from two references will produce the same result.
|
protected Reference(ReferenceLifecycle<L> lifecycle)
public static <T> T acquire(Context context, Reference<T> reference)
release(Context, Object, Reference)
. Calling acquire twice
with the same reference does not guarantee that the same instance will be returned twice.public static <T> void release(Context context, T value, Reference<T> reference)
acquire(Context,
Reference)
. An object that was released calling this function should not be retained or used
in any way.public abstract String getSimpleName()
public static boolean shouldUpdate(Reference previous, Reference next)
Object.equals(Object)
. When defining a custom
reference it's possible to provide custom logic for the comparison implementing a method
annotated with the ShouldUpdate
annotation.