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