Package org.moddingx.libx.util.lazy
Class LazyValue<T>
java.lang.Object
org.moddingx.libx.util.lazy.LazyValue<T>
A lazy value that is resolved when it is first used.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a lazy value that will have the value of the lazy optional if present.get()
Gets the value.<U> LazyValue<U>
Gets a new lazy value that will hold the value of this lazy value applied to the mapper function.static <T> LazyValue<T>
wrap
(net.minecraft.util.LazyLoadedValue<T> value) Wraps aLazyLoadedValue
to a lazy value.
-
Constructor Details
-
LazyValue
Creates a new lazy value. the supplier will be called once when the value is first retrieved.
-
-
Method Details
-
wrap
Wraps aLazyLoadedValue
to a lazy value. -
get
Gets the value. If not yet resolved, resolves the lazy value. -
asDefault
Gets a lazy value that will have the value of the lazy optional if present. If not it will have the value of this lazy value. -
map
Gets a new lazy value that will hold the value of this lazy value applied to the mapper function. The mapper function will also get called lazy.
-