public final class MoreSuppliers extends Object
Utility functions for suppliers.
Modifier and Type | Method and Description |
---|---|
static <X,T> Supplier<T> |
curry(Function<? super X,T> func,
X arg) |
static <T> Supplier<T> |
softMemoize(Supplier<T> supplier)
Softly memoize a supplier.
|
static <T> Supplier<T> |
weakMemoize(Supplier<T> supplier)
Weakly memoize a supplier.
|
public static <T> Supplier<T> weakMemoize(Supplier<T> supplier)
Weakly memoize a supplier.
supplier
- The supplier to memoize. The supplier cannot return null.T
- The type returned by the supplier.supplier
with a weak reference.public static <T> Supplier<T> softMemoize(Supplier<T> supplier)
Softly memoize a supplier.
supplier
- The supplier to memoize. The supplier cannot return null.T
- The type returned by the supplier.supplier
with a soft reference.