public class LazyValue<T>
extends java.lang.Object
implements java.util.function.Supplier<T>
This class is synchronized, meaning multi-thread access causing the value to be resolved is properly handled.
This class is also explicitly NonNull.
Created by covers1624 on 15/4/21.
| Constructor and Description |
|---|
LazyValue(java.util.function.Supplier<T> factory) |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Get or compute the value if it doesn't exist.
|
boolean |
hasValue()
If the value is present or not.
|
public LazyValue(java.util.function.Supplier<T> factory)