Package | Description |
---|---|
net.minecraftforge.common.util |
Modifier and Type | Interface and Description |
---|---|
interface |
NonNullLazy<T>
Proxy object for a value that is calculated on first access.
|
Modifier and Type | Class and Description |
---|---|
static class |
NonNullLazy.Concurrent<T>
Thread-safe implementation.
|
static class |
NonNullLazy.Fast<T>
Non-thread-safe implementation.
|
Modifier and Type | Field and Description |
---|---|
private NonNullSupplier<T> |
NonNullLazy.Fast.supplier |
private NonNullSupplier<T> |
NonNullLazy.Concurrent.supplier |
private NonNullSupplier<T> |
LazyOptional.supplier |
Modifier and Type | Method and Description |
---|---|
static <T> NonNullLazy<T> |
NonNullLazy.concurrentOf(NonNullSupplier<T> supplier)
Constructs a thread-safe lazy-initialized object
|
static <T> NonNullLazy<T> |
NonNullLazy.of(NonNullSupplier<T> supplier)
Constructs a lazy-initialized object
|
static <T> LazyOptional<T> |
LazyOptional.of(NonNullSupplier<T> instanceSupplier)
Construct a new
LazyOptional that wraps the given
NonNullSupplier . |
T |
LazyOptional.orElseGet(NonNullSupplier<? extends T> other)
Resolve the contained supplier if non-empty and return the result, otherwise return the
result of
other . |
<X extends java.lang.Throwable> |
LazyOptional.orElseThrow(NonNullSupplier<? extends X> exceptionSupplier)
Resolve the contained supplier if non-empty and return the result, otherwise throw the
exception created by the provided
NonNullSupplier . |
Constructor and Description |
---|
Concurrent(NonNullSupplier<T> supplier) |
Fast(NonNullSupplier<T> supplier) |
LazyOptional(NonNullSupplier<T> instanceSupplier) |