- Type Parameters:
T- type of the provided object
- All Superinterfaces:
Supplier<T>
A typed supplier that wraps another supplier and only retrieves the value on the first
request to
Supplier.get(), caching the value for all subsequent invocations.
Helidon implementations obtained through create(java.util.function.Supplier)
and create(Object) are guaranteed to be thread safe.
-
Method Summary
-
Method Details
-
create
Create a lazy value from a supplier.- Type Parameters:
T- type of the value- Parameters:
supplier- supplier to get the value from- Returns:
- a lazy value that will obtain the value from supplier on first call to
Supplier.get()
-
create
Create a lazy value from a value.- Type Parameters:
T- type of the value- Parameters:
value- actual value to return- Returns:
- a lazy value that will always return the value provided
-
isLoaded
boolean isLoaded()Return true if the value is loaded, false if the supplier was not invoked.- Returns:
trueif the value is loaded
-