T
- The type of the valuepublic interface Lazy<T>
extends java.util.function.Supplier<T>
Modifier and Type | Interface and Description |
---|---|
static class |
Lazy.Concurrent<T>
Thread-safe implementation.
|
static class |
Lazy.Fast<T>
Non-thread-safe implementation.
|
Modifier and Type | Method and Description |
---|---|
static <T> Lazy<T> |
concurrentOf(java.util.function.Supplier<T> supplier)
Constructs a thread-safe lazy-initialized object
|
static <T> Lazy<T> |
of(java.util.function.Supplier<T> supplier)
Constructs a lazy-initialized object
|
static <T> Lazy<T> of(@Nonnull java.util.function.Supplier<T> supplier)
supplier
- The supplier for the value, to be called the first time the value is needed.static <T> Lazy<T> concurrentOf(@Nonnull java.util.function.Supplier<T> supplier)
supplier
- The supplier for the value, to be called the first time the value is needed.