Package net.minecraftforge.common.util
Interface ClearableLazy<T>
- All Known Implementing Classes:
ClearableLazy.Concurrent
,ClearableLazy.Fast
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Thread-safe implementation.static final class
Non-thread-safe implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ClearableLazy
<T> concurrentOf
(@NotNull Supplier<T> supplier) Constructs a thread-safe lazy-initialized objectvoid
static <T> ClearableLazy
<T> Constructs a lazy-initialized object
-
Method Details
-
invalidate
void invalidate() -
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.
-