public class Functions
extends java.lang.Object
| Constructor and Description |
|---|
Functions() |
| Modifier and Type | Method and Description |
|---|---|
static <E> Function<E,E> |
identity()
Returns the identity function.
|
static Function<java.lang.Object,java.lang.String> |
toStringFunction()
Returns a function that calls
toString() on its argument. |
public static <E> Function<E,E> identity()
public static Function<java.lang.Object,java.lang.String> toStringFunction()
toString() on its argument. The function does not accept
nulls; it will throw a NullPointerException when applied to null.
Warning: The returned function may not be consistent with equals (as
documented at Function.apply(T)). For example, this function yields different results for
the two equal instances ImmutableSet.of(1, 2) and ImmutableSet.of(2, 1).