public final class Lazy
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> @NotNull java.util.function.Supplier<T> |
of(@NotNull java.util.function.Supplier<T> fetch)
Creates a
Supplier that fetches the value upon request at first,
then serves it in subsequent calls. |
@NotNull
public static <T> @NotNull java.util.function.Supplier<T> of(@NotNull
@NotNull java.util.function.Supplier<T> fetch)
Supplier that fetches the value upon request at first,
then serves it in subsequent calls.
This implementation is thread-safe as it performs synchronization on the first call.
T - Supplier typefetch - Fetch function