Package net.minecraftforge.common.util
Interface NonNullLazy<T>
-
- Type Parameters:
T
- The type of the value
- All Superinterfaces:
NonNullSupplier<T>
public interface NonNullLazy<T> extends NonNullSupplier<T>
Proxy object for a value that is calculated on first access. Same asLazy
, but with a nonnull contract.
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T> NonNullLazy<T>
concurrentOf(NonNullSupplier<T> supplier)
Constructs a thread-safe lazy-initialized objectstatic <T> NonNullLazy<T>
of(NonNullSupplier<T> supplier)
Constructs a lazy-initialized object-
Methods inherited from interface net.minecraftforge.common.util.NonNullSupplier
get
-
-
-
-
Method Detail
-
of
static <T> NonNullLazy<T> of(@Nonnull NonNullSupplier<T> supplier)
Constructs a lazy-initialized object- Parameters:
supplier
- The supplier for the value, to be called the first time the value is needed.
-
concurrentOf
static <T> NonNullLazy<T> concurrentOf(@Nonnull NonNullSupplier<T> supplier)
Constructs a thread-safe lazy-initialized object- Parameters:
supplier
- The supplier for the value, to be called the first time the value is needed.
-
-