1package dev.rafex.ether.di;
29import java.util.Objects;
30import java.util.function.Supplier;
46public final class Lazy<T> {
48 private volatile T value;
49 private volatile Supplier<T> supplier;
56 public Lazy(
final Supplier<T> supplier) {
57 this.supplier = Objects.requireNonNull(supplier,
"supplier");
72 v = Objects.requireNonNull(supplier.get(),
"Lazy supplier returned null");
Lazy(final Supplier< T > supplier)
Creates a new Lazy backed by the given supplier.
boolean isInitialized()
Returns true if the value has already been initialized.