Class Lazy.Actionable<T>
java.lang.Object
net.minecraftforge.gradleutils.shared.Lazy<T>
net.minecraftforge.gradleutils.shared.Lazy.Actionable<T>
- Type Parameters:
T- The type of result
Represents a lazily computed value with the ability to optionally work with it using
Lazy.ifPresent(Action) and
safely mutate it using map(Action).-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.gradleutils.shared.Lazy
Lazy.Actionable<T> -
Field Summary
-
Method Summary
Methods inherited from class net.minecraftforge.gradleutils.shared.Lazy
actionable, actionable, call, ifPresent, simple, simple
-
Method Details
-
map
Queues the given action to run on the value once it has been computed. If the value has already been resolved, the action will be executed instantly.
This marks this lazy as present, meaning that any usage of
Lazy.ifPresent(Action)will resolve the value.- Parameters:
action- The action to run
-
isPresent
public boolean isPresent()Checks if this actionable lazy is present. Presence can either mean that the value has already been computed or has been mutated bymap(Action). -
copy
Copies this actionable lazy. This can be useful if you need to split off execution paths and have the same object with different mutations at a specific time.- Returns:
- A new actionable lazy copied from this one
-
get
-