Modifier and Type | Field and Description |
---|---|
static Function<Number,Float> |
FLOAT_VALUE
A function that returns the float value of a number.
|
static Function<Number,Integer> |
INT_VALUE
A function that returns the int value of a number.
|
static Function<Object,Boolean> |
IS_NULL
A function that returns true for null values and false for non-null values.
|
static Function<Object,Boolean> |
NON_NULL
A function that returns true for non-null values and false for null values.
|
static Function<Boolean,Boolean> |
NOT
Implements boolean not.
|
static Function<Object,String> |
TO_STRING
A function that applies
String.valueOf(java.lang.Object) to its argument. |
Constructor and Description |
---|
Functions() |
Modifier and Type | Method and Description |
---|---|
static <E> Function<Object,E> |
constant(E constant)
Returns a function that always returns the supplied constant value.
|
static <K,V> Function<K,V> |
forMap(Map<K,? extends V> map,
V defaultValue)
Returns a function which performs a map lookup with a default value.
|
static Function<Integer,Boolean> |
greaterThan(int target)
Returns a function that computes whether a value is greater than
target . |
static Function<Integer,Boolean> |
greaterThanEqual(int target)
Returns a function that computes whether a value is greater than or equal to
value . |
static <T> Function<T,T> |
identity()
Returns the identity function for type
T . |
static Function<Integer,Boolean> |
lessThan(int target)
Returns a function that computes whether a value is less than
target . |
static Function<Integer,Boolean> |
lessThanEqual(int target)
Returns a function that computes whether a value is less than or equal to
target . |
static <T> Function<T,String> |
prefix(String prefix)
Returns a function which returns its argument as a string with
prefix prepended. |
static <T> Function<T,String> |
suffix(String suffix)
Returns a function which returns its argument as a string with
suffix appended. |
public static Function<Object,String> TO_STRING
String.valueOf(java.lang.Object)
to its argument.public static Function<Object,Boolean> IS_NULL
public static Function<Object,Boolean> NON_NULL
public static Function<Number,Float> FLOAT_VALUE
public static <E> Function<Object,E> constant(E constant)
public static Function<Integer,Boolean> greaterThan(int target)
target
.public static Function<Integer,Boolean> greaterThanEqual(int target)
value
.public static Function<Integer,Boolean> lessThan(int target)
target
.public static Function<Integer,Boolean> lessThanEqual(int target)
target
.public static <K,V> Function<K,V> forMap(Map<K,? extends V> map, V defaultValue)
public static <T> Function<T,String> prefix(String prefix)
prefix
prepended.public static <T> Function<T,String> suffix(String suffix)
suffix
appended.public static <T> Function<T,T> identity()
T
.Copyright © 2017. All rights reserved.