T - the generic type of the provided valuepublic class LazyValue<T> extends Object implements Supplier<T>
The value is only computed on the first invokation of get(). Subsequent calls to such method will always return the
same value.
This class is thread-safe. When invoking get(), it is guaranteed that the value will be computed only once.
public LazyValue(Supplier<T> supplier)
supplier. It is guaranteed that
Supplier.get() will only be invoked once. Because this class is thread-safe, the supplier is not required to be.supplier - A Supplier through which the value is obtainedCopyright © 2024. All rights reserved.