Class LazyValue<T>
java.lang.Object
nl.pim16aap2.util.LazyValue<T>
- Type Parameters:
T- The type of the object to initialize lazily.
- All Implemented Interfaces:
dagger.Lazy<T>
Represents a lazily initialized object.
Initialization is thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanget()Gets the lazily initialized object.inthashCode()Note that calling this method will result inget()being called.booleanChecks whether the lazily initialized value has been initialized yet.@Nullable Treset()Resets the lazily initialized value (if it has been initialized yet).toString()
-
Constructor Details
-
LazyValue
-
-
Method Details
-
get
-
isInitialized
public boolean isInitialized()Checks whether the lazily initialized value has been initialized yet.- Returns:
- True if the value has been initialized, false otherwise.
-
reset
Resets the lazily initialized value (if it has been initialized yet).- Returns:
- The previously-initialized value or null if it was not initialized yet.
-
equals
-
hashCode
-
toString
-