Package org.stianloader.smatterdi
Class Lazy<T>
java.lang.Object
org.stianloader.smatterdi.Lazy<T>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Lazy
-
Lazy
-
-
Method Details
-
get
Obtains the value of the lazy.If the value hasn't yet been computed, the value will get computed and all registered configurators are called on the computed value.
A lazy will not be computed twice if the supplier or a configurator throws a
Throwable. Instead, the exception will be rethrown in a packaged form.- Returns:
- The value of the lazy
-
getIfPresent
If the value of the lazy object was already calculated, this method returns a non-empty options. Otherwise (asget()was not called yet), it will return an empty optional.- Returns:
- The current value of the optional
-
configure
-
isDone
public boolean isDone()
-