T - The supplier result type.public final class MemoizedSupplier<T> extends Object implements Supplier<T>
Supplier
which gets a value by invoking its initializer once
and then keeps returning the same value as its supplied results.
This class is thread safe.| Modifier and Type | Method and Description |
|---|---|
T |
get() |
boolean |
isInitialized() |
static <T> MemoizedSupplier<T> |
valueOf(Supplier<T> supplier) |
public static <T> MemoizedSupplier<T> valueOf(Supplier<T> supplier)
supplier - to supply at most one non-null value.MemoizedSupplier with the given supplier.public T get()
public boolean isInitialized()
Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.