Package org.ehrbase.util
Class Lazy<V>
java.lang.Object
org.ehrbase.util.Lazy<V>
- Type Parameters:
V-
- All Implemented Interfaces:
Supplier<V>
Lazy property value that can be used to cache values with "expensive" calculations during first time of access.
Usage:
import static org.ehrbase.util.Lazy.lazy;
class MyClass {
private final Supplier<String> lazyValue = lazy(() -> "some expensive calculated value");
public String getValue() {
return lazyValue.get();
}
}
-
Constructor Summary
Constructors -
Method Summary