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