RETURN - The return type of the supplier.THROW - The throwable type of the supplier.public final class MemoizedCheckedSupplier<RETURN,THROW extends Throwable> extends Object implements CheckedSupplier<RETURN,THROW>
CheckedSupplier
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.| 限定符和类型 | 方法和说明 |
|---|---|
RETURN |
get()
The same as
Supplier.get()
except that this method is declared with a throws-clause. |
RETURN |
getUnchecked() |
boolean |
isInitialized() |
String |
toString() |
static <RETURN,THROW extends Throwable> |
valueOf(CheckedSupplier<RETURN,THROW> supplier) |
public static <RETURN,THROW extends Throwable> MemoizedCheckedSupplier<RETURN,THROW> valueOf(CheckedSupplier<RETURN,THROW> supplier)
supplier - to supply at most one non-null value.MemoizedCheckedSupplier with the given supplier.public RETURN get() throws THROW extends Throwable
CheckedSupplierSupplier.get()
except that this method is declared with a throws-clause.public RETURN getUnchecked()
NullPointerException - if the object is uninitialized.public boolean isInitialized()
Copyright © 2017–2023 The Apache Software Foundation. All rights reserved.