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
Modifier and TypeInterfaceDescriptionstatic class
Thread-safe implementation.static 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.
-