|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.util.concurrent.Functions
public final class Functions
Method Summary | ||
---|---|---|
static
|
fromSupplier(Supplier<R> supplier)
Get a function that uses the Supplier as a factory for all inputs. |
|
static
|
identity()
Get a function that always returns the input. |
|
static
|
toGoogleFunction(Function<T,R> function)
Map to a google-collections Function. |
|
static
|
weakMemoize(Function<T,R> f)
Get a function that weakly memoizes the output – ie. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <D,R> Function<D,R> fromSupplier(@NotNull Supplier<R> supplier)
D
- the key type, ignoredR
- the result typesupplier
- called for all inputs
public static <T> Function<T,T> identity()
T
- the type of the input and the output for the function.
public 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.
public static <T,R> com.google.common.base.Function<T,R> toGoogleFunction(Function<T,R> function)
T
- input typeR
- output typefunction
- the function to map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |