Class Lazy.ThreadLocalLazy<T>
java.lang.Object
ru.progrm_jarvis.javacommons.lazy.Lazy.ThreadLocalLazy<T>
- Type Parameters:
T- type of wrapped value
Lazy which stores its values thread-locally.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ru.progrm_jarvis.javacommons.lazy.Lazy
Lazy.DoubleCheckedLazy<T>, Lazy.LockingWeakLazy<T>, Lazy.SimpleLazy<T>, Lazy.SimpleWeakLazy<T>, Lazy.ThreadLocalLazy<T> -
Method Summary
Modifier and TypeMethodDescriptionget()Gets the wrapped value initializing it once requested.Gets the wrapped value wrapped inResultif it is already initialized or aResult.nullError()otherwise.Gets the wrapped value if it is already initialized ornullotherwise.booleanTests if the value of this lazy was initialized.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ru.progrm_jarvis.javacommons.lazy.Lazy
getAsOptional
-
Method Details
-
get
Description copied from interface:LazyGets the wrapped value initializing it once requested. -
isInitialized
public boolean isInitialized()Description copied from interface:LazyTests if the value of this lazy was initialized.- Specified by:
isInitializedin interfaceLazy<T>- Returns:
trueif this lazy's value was initialize andfalseotherwise
-
getInitializedOrNull
Description copied from interface:LazyGets the wrapped value if it is already initialized ornullotherwise.- Specified by:
getInitializedOrNullin interfaceLazy<T>- Returns:
- wrapped value if it is already initialized or
nullotherwise - See Also:
-
getAsResult
Description copied from interface:LazyGets the wrapped value wrapped inResultif it is already initialized or aResult.nullError()otherwise.- Specified by:
getAsResultin interfaceLazy<T>- Returns:
- wrapped value wrapped in
Resultif it is already initialized orResult.nullError()otherwise
-