public final class Functions extends Object
| Modifier and Type | Method and Description |
|---|---|
static <D,R> Function<D,R> |
fromSupplier(Supplier<R> supplier)
Get a function that uses the Supplier as a factory for all inputs.
|
static <T,R> Function<T,R> |
weakMemoize(Function<T,R> f)
Get a function that weakly memoizes the output – ie.
|
public static <D,R> Function<D,R> fromSupplier(@NotNull Supplier<R> supplier)
D - the key type, ignoredR - the result typesupplier - called for all inputspublic static <T,R> Function<T,R> weakMemoize(Function<T,R> f)
T - the input or key type for the function. Must be a value
(immutable) and have a well behaved hashcode implementation.R - the output type of the for the function.f - the function to call if the value is not already cached.Copyright © 2024 Atlassian. All rights reserved.