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