Package net.minecraftforge.common.util
Interface Lazy<T>
- Type Parameters:
T
- The type of the value
- All Superinterfaces:
Supplier<T>
- All Known Subinterfaces:
ClearableLazy<T>
- All Known Implementing Classes:
ClearableLazy.Concurrent
,ClearableLazy.Fast
,Lazy.Concurrent
,Lazy.Fast
Proxy object for a value that is calculated on first access
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Thread-safe implementation.static final class
Non-thread-safe implementation. -
Method Summary
-
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.
-