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