public static enum Lang.F extends Enum<Lang.F>
The namespace to aggregate predefined core functions
| Modifier and Type | Field and Description |
|---|---|
static Lang.F1 |
AS_STRING
A predefined function that when applied to an object instance, returns String representation of the instance
|
static Lang.F2 |
EQ
A predefined function that applies to two parameters and check if they are equals to each other
|
static Lang.F2 |
EQUAL
Alias of
EQ |
static Lang.Predicate |
FALSE
A predefined forever FALSE predicate which always return
false for whatever element been tested |
static Lang.F2 |
GREATER_THAN
A function that apply to two parameters then return
true if the first parameter is greater than the second one. |
static Lang.F2 |
GREATER_THAN_OR_EQUAL_TO
A function that apply to two parameters then return
true if the first parameter is greater than or equal to the second one. |
static Lang.F1 |
HASH_CODE
A predefined function that calculate hash code of an object
|
static Lang.F1 |
IDENTITY
A predefined function that when apply to a parameter it return it directly, so for any Object o
|
static Lang.Predicate |
IS_NULL
|
static Lang.F2 |
LESS_THAN
A function that apply to two parameters then return
true if the first parameter is less than the second one. |
static Lang.F2 |
LESS_THAN_OR_EQUAL_TO
A function that apply to two parameters then return
true if the first parameter is less than or equal to the second one. |
static Lang.Comparator |
NATURAL_ORDER |
static Lang.F2 |
NE
A predefined function that applies to two parameters and check if they are not equals to each other.
|
static Lang.Predicate<Field> |
NON_STATIC_FIELD
A predicate function that when applied to a
Field type object, returns true when the field is not static |
static Lang.F2 |
NOT_EQUAL
Alias of
NE |
static Lang.Predicate |
NOT_NULL
A predefined
Predicate predicate test if the element specified is NOT null |
static Lang.Comparator |
REVERSE_ORDER |
static Lang.Predicate |
TRUE
A predefined forever true predicate which returns
true on any element been tested |
| Modifier and Type | Method and Description |
|---|---|
static <T> Lang.Predicate<T> |
and(Collection<Lang.Function<? super T,Boolean>> predicates)
Returns a composed
Lang.Predicate function that for any given parameter, the test result is true only when all of the specified predicates returns true when applied to the parameter |
static <T> Lang.Predicate<T> |
and(Lang.Function<? super T,Boolean>... predicates)
Returns a composed
Lang.Predicate function that for any given parameter, the test result is true only when all of the specified predicates returns true when applied to the parameter |
static <T> Lang.Predicate<T> |
any(Collection<Lang.Function<? super T,Boolean>> predicates)
Alias of
or(Collection) |
static <T> Lang.Predicate<T> |
any(Lang.Function<? super T,Boolean>... predicates)
Alias of
#or(Function[]) |
static <T> Lang.F1<T,String> |
asString()
A type-safe version of
AS_STRING. |
static <T> Lang.F1<T,String> |
asString(Class<T> tClass)
Type safe version of
AS_STRING. |
static <T1,T2> Lang.F2<T1,T2,Void> |
breakIf(Lang.Func2<? super T1,? super T2,Boolean> predicate)
Return a two variables function that throw out a
Lang.Break when a two variables predicate return true on an element been tested. |
static <P,T1,T2> Lang.F2<T1,T2,Void> |
breakIf(Lang.Func2<? super T1,? super T2,Boolean> predicate,
P payload)
Return a two variables function that throw out a
Lang.Break with payload specified when a two variables predicate return true on an element been tested |
static <T1,T2,T3> Lang.F3<T1,T2,T3,Void> |
breakIf(Lang.Func3<? super T1,? super T2,? super T3,Boolean> predicate)
Return a three variables function that throw out a
Lang.Break when a three variables predicate return true on an element been tested. |
static <P,T1,T2,T3> |
breakIf(Lang.Func3<? super T1,? super T2,? super T3,Boolean> predicate,
P payload)
Return a three variables function that throw out a
Lang.Break with payload specified when a three variables predicate return true on an element been tested |
static <T1,T2,T3,T4> |
breakIf(Lang.Func4<? super T1,? super T2,? super T3,? super T4,Boolean> predicate)
Return a four variables function that throw out a
Lang.Break when the predicate returns true on an element been tested. |
static <P,T1,T2,T3,T4> |
breakIf(Lang.Func4<? super T1,? super T2,? super T3,? super T4,Boolean> predicate,
P payload)
Return a four variables function that throw out a
Lang.Break with payload specified when a four variables predicate return true on an element been tested |
static <T1,T2,T3,T4,T5> |
breakIf(Lang.Func5<? super T1,? super T2,? super T3,? super T4,? super T5,Boolean> predicate)
Return a five variables function that throw out a
Lang.Break when the predicate returns true on an element been tested. |
static <P,T1,T2,T3,T4,T5> |
breakIf(Lang.Func5<? super T1,? super T2,? super T3,? super T4,? super T5,Boolean> predicate,
P payload)
Return a five variables function that throw out a
Lang.Break with payload specified when a five variables predicate return true on an element been tested |
static <T> Lang.F1<T,Void> |
breakIf(Lang.Function<? super T,Boolean> predicate)
Return a one variable function that throw out a
Lang.Break when a predicate return true on an element been tested. |
static <P,T> Lang.F1<T,Void> |
breakIf(Lang.Function<? super T,Boolean> predicate,
P payload)
Return a one variable function that throw out a
Lang.Break with payload specified when a predicate return true on an element been tested |
static <T,U extends Comparable<? super U>> |
comparing(Lang.Function<? super T,? extends U> keyExtractor) |
static <T,U> Lang.Comparator<T> |
comparing(Lang.Function<? super T,? extends U> keyExtractor,
Comparator<? super U> keyComparator)
Construct a
Comparator with a function to extract the key of type U from given object of type T and a comparator to compare type U |
static <P1,P2> Lang.F2<P1,P2,Boolean> |
eq()
The type-safe version of
EQ |
static <P> Lang.Predicate<P> |
eq(P element)
Returns a
Lang.Predicate that checkes if the argument equals to the element specified |
static <P1,P2> Lang.F2<P1,P2,Boolean> |
equal()
Alias of
eq() |
static Lang.Predicate<Field> |
fieldWithAnnotation(Class<? extends Annotation> annoClass)
Returns a predicate function that when applied to a
Field type object, returns true if the field has specified annotation presented |
static <T extends Comparable<T>> |
greaterThan()
Alias of
gt() |
static <T> Lang.F2<T,T,Boolean> |
greaterThan(Comparator<? super T> c)
Alias of
gt(java.util.Comparator) |
static <T> Lang.F2<T,T,Boolean> |
greaterThan(Lang.Func2<? super T,? super T,Integer> c)
Alias of
gt(java.util.Comparator) |
static <T extends Comparable<T>> |
greaterThan(T v)
Alias of
gt(Comparable) |
static <T extends Comparable<T>> |
greaterThanOrEqualsTo()
Alias of
gte() |
static <T> Lang.F2<T,T,Boolean> |
greaterThanOrEqualsTo(Comparator<? super T> c)
Alias of
gte(java.util.Comparator) |
static <T> Lang.F2<T,T,Boolean> |
greaterThanOrEqualsTo(Lang.Func2<? super T,? super T,Integer> c)
Alias of
gte(java.util.Comparator) |
static <T extends Comparable<T>> |
greaterThanOrEqualsTo(T v)
Alias of
gte(Comparable) |
static <T extends Comparable<T>> |
gt()
Returns a function that check if a value is less than another one.
|
static <T> Lang.F2<T,T,Boolean> |
gt(Comparator<? super T> c)
Returns a function that check if a value is less than another one using the
Comparator specified |
static <T> Lang.F2<T,T,Boolean> |
gt(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than another one using the
Comparator specified |
static <T extends Comparable<T>> |
gt(T v)
Returns a function that apply to one parameter and compare it with the value
v specified, returns true if the parameter applied is greater than v |
static <T extends Comparable<T>> |
gte()
Returns a function that check if a value is greater than or equals to another one.
|
static <T> Lang.F2<T,T,Boolean> |
gte(Comparator<? super T> c)
Returns a function that check if a value is greater than or equals to another one using the
Comparator specified |
static <T> Lang.F2<T,T,Boolean> |
gte(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is greater than or equals to another one using the
Comparator specified |
static <T extends Comparable<T>> |
gte(T v)
Returns a function that apply to one parameter and compare it with the value
v specified, returns true if the parameter applied is greater than or equals to v |
static <T> Lang.F1<T,Integer> |
hc()
The type-safe version of
HASH_CODE |
static <T> Lang.F1<T,T> |
identity()
The type-safe version of
IDENTITY |
static <T> Lang.F1<T,T> |
identity(Class<T> clz)
The type-safe version of
IDENTITY |
static <X,Y> Lang.Bijection<Y,X> |
invert(Lang.Bijection<X,Y> f)
Returns a inverted function of
Lang.Bijection which map from X to Y, and the returned function map from Y to X. |
static <T> Lang.Predicate<T> |
isNull()
The type-safe version of
IS_NULL |
static <T> Lang.Predicate<T> |
isNull(Class<T> c)
The type-safe version of
IS_NULL |
static <T extends Comparable<T>> |
lessThan()
Alias of
lt() |
static <T> Lang.F2<T,T,Boolean> |
lessThan(Comparator<? super T> c)
Alias of
lt(java.util.Comparator) |
static <T> Lang.F2<T,T,Boolean> |
lessThan(Lang.Func2<? super T,? super T,Integer> c)
Alias of
lt(java.util.Comparator) |
static <T extends Comparable<T>> |
lessThan(T v)
Alias of
lt(Comparable) |
static <T extends Comparable<T>> |
lessThanOrEqualsTo()
Alias of
lte() |
static <T> Lang.F2<T,T,Boolean> |
lessThanOrEqualsTo(Comparator<? super T> c)
Alias of
lte(java.util.Comparator) |
static <T> Lang.F2<T,T,Boolean> |
lessThanOrEqualsTo(Lang.Func2<? super T,? super T,Integer> c)
Alias of
lte(java.util.Comparator) |
static <T extends Comparable<T>> |
lessThanOrEqualsTo(T v)
Alias of
lte(Comparable) |
static <T extends Comparable<T>> |
lt()
Returns a function that check if a value is less than another one.
|
static <T> Lang.F2<T,T,Boolean> |
lt(Comparator<? super T> c)
Returns a function that check if a value is less than another one using the
Comparator specified |
static <T> Lang.F2<T,T,Boolean> |
lt(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than another one using the
Comparator specified |
static <T extends Comparable<T>> |
lt(T v)
Returns a function that apply to one parameter and compare it with the value
v specified, returns true if the parameter applied is less than v |
static <T extends Comparable<T>> |
lte()
Returns a function that check if a value is less than or equals to another one.
|
static <T> Lang.F2<T,T,Boolean> |
lte(Comparator<? super T> c)
Returns a function that check if a value is less than or equals to another one using the
Comparator specified |
static <T> Lang.F2<T,T,Boolean> |
lte(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than or equals to another one using the
Comparator specified |
static <T extends Comparable<T>> |
lte(T v)
Returns a function that apply to one parameter and compare it with the value
v specified, returns true if the parameter applied is less than or equals to v |
static <T extends Comparable<T>> |
naturalOrder() |
static <P1,P2> Lang.F2<P1,P2,Boolean> |
ne()
The type-safe version of
NE |
static Lang.F0<Boolean> |
negate(Lang.Func0<Boolean> predicate)
Returns a negate function of the specified predicate function
|
static <P1,P2> Lang.F2<P1,P2,Boolean> |
negate(Lang.Func2<? super P1,? super P2,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 2 parameters and returns boolean value
|
static <P1,P2,P3> Lang.F3<P1,P2,P3,Boolean> |
negate(Lang.Func3<? super P1,? super P2,? super P3,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 3 parameters and returns boolean value
|
static <P1,P2,P3,P4> |
negate(Lang.Func4<? super P1,? super P2,? super P3,? super P4,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 3 parameters and returns boolean value
|
static <P1,P2,P3,P4,P5> |
negate(Lang.Func5<? super P1,? super P2,? super P3,? super P4,? super P5,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 3 parameters and returns boolean value
|
static <T> Lang.Predicate<T> |
negate(Lang.Function<? super T,Boolean> predicate)
Returns a negate function of the specified predicate function that applied to 1 params and returns boolean value
|
static <T> Lang.Predicate<T> |
no()
A type-safe version of
FALSE |
static <T> Lang.Predicate<T> |
none(Collection<Lang.Function<? super T,Boolean>> predicates)
Negation of
or(Collection) |
static <T> Lang.Predicate<T> |
none(Lang.Function<? super T,Boolean>... predicates)
Negation of
#or(Function[]) |
static <T> Lang.F1<T,Boolean> |
not()
Returns a function that evaluate an argument’s boolean value and negate the value.
|
static <P1,P2> Lang.F2<P1,P2,Boolean> |
notEqual()
Alias of
ne() |
static <T> Lang.Predicate<T> |
or(Collection<Lang.Function<? super T,Boolean>> predicates)
Returns a composed
Lang.Predicate function that for any given parameter, the test result is true only when any one of the specified predicates returns true when applied to the parameter |
static <T> Lang.Predicate<T> |
or(Lang.Function<? super T,Boolean>... predicates)
Returns a composed
Lang.Predicate function that for any given parameter, the test result is true when any one of the specified predicates returns true on the parameter |
static <BEAN> Lang.Transformer<BEAN,Object> |
propertyExtractor(String property) |
static <T> Lang.Val<T> |
provides(T obj)
Return a provider that when called will return the object specified
|
static <T> Lang.Predicate<T> |
requireNotNull()
The type-safe version of
NOT_NULL |
static <T> Lang.Comparator<T> |
reverse(Comparator<? super T> c) |
static <T extends Comparable<? super T>> |
reverseOrder() |
static Lang.F |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Lang.F[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static <T> Lang.Predicate<T> |
yes()
A type-safe version of
TRUE |
public static final Lang.Predicate TRUE
A predefined forever true predicate which returns true on any element been tested
yes()public static final Lang.Predicate FALSE
A predefined forever FALSE predicate which always return false for whatever element been tested
no()public static final Lang.Predicate IS_NULL
A predefined Predicate predicate test if the element specified is null or Lang.NONE.
public static final Lang.Predicate NOT_NULL
A predefined Predicate predicate test if the element specified is NOT null
public static final Lang.F1 IDENTITY
A predefined function that when apply to a parameter it return it directly, so for any Object o
IDENTITY.apply(o) == o;
public static final Lang.F2 LESS_THAN
A function that apply to two parameters then return true if the first parameter is less than the second one. The type of the two parameter should be the same and should implements Comparable
public static final Lang.F2 GREATER_THAN
A function that apply to two parameters then return true if the first parameter is greater than the second one. The type of the two parameter should be the same and should implements Comparable
public static final Lang.F2 LESS_THAN_OR_EQUAL_TO
A function that apply to two parameters then return true if the first parameter is less than or equal to the second one. The type of the two parameter should be the same and should implements Comparable
public static final Lang.F2 GREATER_THAN_OR_EQUAL_TO
A function that apply to two parameters then return true if the first parameter is greater than or equal to the second one. The type of the two parameter should be the same and should implements Comparable
public static final Lang.F2 EQ
A predefined function that applies to two parameters and check if they are equals to each other
public static final Lang.F2 NE
A predefined function that applies to two parameters and check if they are not equals to each other. This is a negate function of EQ
public static final Lang.Comparator NATURAL_ORDER
public static final Lang.Comparator REVERSE_ORDER
public static final Lang.F1 HASH_CODE
A predefined function that calculate hash code of an object
Lang.hc(Object)public static final Lang.F1 AS_STRING
A predefined function that when applied to an object instance, returns String representation of the instance
Lang.toString2(Object)public static Lang.Predicate<Field> NON_STATIC_FIELD
A predicate function that when applied to a Field type object, returns true when the field is not static
public static Lang.F[] values()
for (Lang.F c : Lang.F.values()) System.out.println(c);
public static Lang.F valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static <P,T> Lang.F1<T,Void> breakIf(Lang.Function<? super T,Boolean> predicate, P payload)
Return a one variable function that throw out a Lang.Break with payload specified when a predicate return true on an element been tested
P - the type of the payload objectT - the type of the object to be consumed by the predicatepredicate - the predicate function that takes T type argumentpayload - the payload to be passed into the Lang.Break if predicate returns truetrue then throw out the Break with payload specifiedpublic static <T> Lang.F1<T,Void> breakIf(Lang.Function<? super T,Boolean> predicate)
Return a one variable function that throw out a Lang.Break when a predicate return true on an element been tested. There is no payload specified and the Break will use test result i.e. true as the payload
T - the type of the object consumed by the predicatepredicate - the predicate functiontrue then throw out a Lang.Break with payload of the object been consumedpublic static <P,T1,T2> Lang.F2<T1,T2,Void> breakIf(Lang.Func2<? super T1,? super T2,Boolean> predicate, P payload)
Return a two variables function that throw out a Lang.Break with payload specified when a two variables predicate return true on an element been tested
P - the payload typeT1 - the type of the first argumentT2 - the type of the second argumentpredicate - the function test the argumentspayload - the payload to be thrown out if predicate function returns true on the argumentLang.Break with payload specifiedpublic static <T1,T2> Lang.F2<T1,T2,Void> breakIf(Lang.Func2<? super T1,? super T2,Boolean> predicate)
Return a two variables function that throw out a Lang.Break when a two variables predicate return true on an element been tested. There is no payload specified and the Break will use test result i.e. true as the payload
T1 - the type of argument 1T2 - the type of argument 2predicate - the predicate function check if a break should be raisedLang.Break if predicate function says true on the two argumentspublic static <P,T1,T2,T3> Lang.F3<T1,T2,T3,Void> breakIf(Lang.Func3<? super T1,? super T2,? super T3,Boolean> predicate, P payload)
Return a three variables function that throw out a Lang.Break with payload specified when a three variables predicate return true on an element been tested
P - Generic type for payloadT1 - generic type of the first argument taken by predicateT2 - generic type of the second argument taken by predicateT3 - generic type of the thrid argument taken by predicatepredicate - the predicate function that takes three arguments and returns a boolean type valuepayload - the payload object to beF3<T1, T2, T3, Void> typepublic static <T1,T2,T3> Lang.F3<T1,T2,T3,Void> breakIf(Lang.Func3<? super T1,? super T2,? super T3,Boolean> predicate)
Return a three variables function that throw out a Lang.Break when a three variables predicate return true on an element been tested. There is no payload specified and the Break will use test result i.e. true as the payload
T1 - the generic type of the argument 1T2 - the generic type of the argument 2T3 - the generic type of the argument 3predicate - the predicate function that takes three arguments and returns a boolean type valuetrue if the check returns truepublic static <P,T1,T2,T3,T4> Lang.F4<T1,T2,T3,T4,Void> breakIf(Lang.Func4<? super T1,? super T2,? super T3,? super T4,Boolean> predicate, P payload)
Return a four variables function that throw out a Lang.Break with payload specified when a four variables predicate return true on an element been tested
P - the generic type of the payloadT1 - the generic type of the argument 1T2 - the generic type of the argument 2T3 - the generic type of the argument 3T4 - the generic type of the argument 4predicate - the predicate function that takes four arguments and returns a boolean type valuepayload - the payload to be throw out if the predicate function returns true on given argumentstruepublic static <T1,T2,T3,T4> Lang.F4<T1,T2,T3,T4,Void> breakIf(Lang.Func4<? super T1,? super T2,? super T3,? super T4,Boolean> predicate)
Return a four variables function that throw out a Lang.Break when the predicate returns true on an element been tested. There is no payload specified and the Break will use test result i.e. true as the payload
T1 - the generic type of the argument 1T2 - the generic type of the argument 2T3 - the generic type of the argument 3T4 - the generic type of the argument 4predicate - the predicate function that takes four arguments and returns a boolean type valuetrue if the check returns truepublic static <P,T1,T2,T3,T4,T5> Lang.F5<T1,T2,T3,T4,T5,Void> breakIf(Lang.Func5<? super T1,? super T2,? super T3,? super T4,? super T5,Boolean> predicate, P payload)
Return a five variables function that throw out a Lang.Break with payload specified when a five variables predicate return true on an element been tested
P - the generic type of the payloadT1 - the generic type of the argument 1T2 - the generic type of the argument 2T3 - the generic type of the argument 3T4 - the generic type of the argument 4T5 - the generic type of the argument 5predicate - the predicate function that takes five arguments and returns a boolean type valuepayload - the payload to be throw out if the predicate function returns true on given argumentstruepublic static <T1,T2,T3,T4,T5> Lang.F5<T1,T2,T3,T4,T5,Void> breakIf(Lang.Func5<? super T1,? super T2,? super T3,? super T4,? super T5,Boolean> predicate)
Return a five variables function that throw out a Lang.Break when the predicate returns true on an element been tested. There is no payload specified and the Break will use test result i.e. true as the payload
T1 - the generic type of the argument 1T2 - the generic type of the argument 2T3 - the generic type of the argument 3T4 - the generic type of the argument 4T5 - the generic type of the argument 5predicate - the predicate function that takes five arguments and returns a boolean type valuetrue if the check returns truepublic static <T> Lang.Predicate<T> and(Collection<Lang.Function<? super T,Boolean>> predicates)
Returns a composed Lang.Predicate function that for any given parameter, the test result is true only when all of the specified predicates returns true when applied to the parameter
T - the type of the parameter the predicates applied topredicates - a collection of predicates that can be applied to a parameter and returns boolean valuepublic static <T> Lang.Predicate<T> and(Lang.Function<? super T,Boolean>... predicates)
Returns a composed Lang.Predicate function that for any given parameter, the test result is true only when all of the specified predicates returns true when applied to the parameter
T - the type of the parameter the predicates applied topredicates - an array of predicates that can be applied to a parameter and returns boolean valuepublic static <T> Lang.Predicate<T> or(Collection<Lang.Function<? super T,Boolean>> predicates)
Returns a composed Lang.Predicate function that for any given parameter, the test result is true only when any one of the specified predicates returns true when applied to the parameter
T - the type of the parameter the predicates applied topredicates - a collection of predicates that can be applied to a parameter and returns boolean valuepublic static <T> Lang.Predicate<T> or(Lang.Function<? super T,Boolean>... predicates)
Returns a composed Lang.Predicate function that for any given parameter, the test result is true when any one of the specified predicates returns true on the parameter
T - the type of the parameter the predicates applied topredicates - an array of predicates that can be applied to a parameter and returns boolean valuepublic static <T> Lang.Predicate<T> any(Collection<Lang.Function<? super T,Boolean>> predicates)
Alias of or(Collection)
T - the element typepredicates - the predicate functionstrue if any one of the predicates returns true on a given argumentpublic static <T> Lang.Predicate<T> any(Lang.Function<? super T,Boolean>... predicates)
Alias of #or(Function[])
T - the argument typepredicates - an array of predicate functionstrue if any one of the predicate function returns truepublic static <T> Lang.Predicate<T> none(Collection<Lang.Function<? super T,Boolean>> predicates)
Negation of or(Collection)
T - the generic type of the argument the predicate functions takepredicates - an iterable of predicate functionstrue if all of them return false on the argument, or false if any one of them returns truepublic static <T> Lang.Predicate<T> none(Lang.Function<? super T,Boolean>... predicates)
Negation of #or(Function[])
T - the generic type of the argument the predicate functions takepredicates - an array of predicate functionstrue if all of them return false on the argument, or false if any one of them returns truepublic static <T> Lang.F1<T,Boolean> not()
Returns a function that evaluate an argument’s boolean value and negate the value.
T - the type of the argument the function applied topublic static <X,Y> Lang.Bijection<Y,X> invert(Lang.Bijection<X,Y> f)
Returns a inverted function of Lang.Bijection which map from X to Y, and the returned function map from Y to X. This function will call Lang.Bijection.invert() to get the return function
X - the argument type, and the result type of the return functionY - the result type, and the argument type of the return functionf - the bijection function to be invertedfpublic static Lang.F0<Boolean> negate(Lang.Func0<Boolean> predicate)
Returns a negate function of the specified predicate function
predicate - the specified function that returns boolean valuepublic static <T> Lang.Predicate<T> negate(Lang.Function<? super T,Boolean> predicate)
Returns a negate function of the specified predicate function that applied to 1 params and returns boolean value
T - the type of the parameter to be appliedpredicate - the specified function that applied to the parameter and returns boolean valuepublic static <P1,P2> Lang.F2<P1,P2,Boolean> negate(Lang.Func2<? super P1,? super P2,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 2 parameters and returns boolean value
P1 - type of param oneP2 - type of param twopredicate - the function applied to 2 params and return boolean valuepublic static <P1,P2,P3> Lang.F3<P1,P2,P3,Boolean> negate(Lang.Func3<? super P1,? super P2,? super P3,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 3 parameters and returns boolean value
P1 - type of param oneP2 - type of param twoP3 - type of param threepredicate - the function applied to 2 params and return boolean valuepublic static <P1,P2,P3,P4> Lang.F4<P1,P2,P3,P4,Boolean> negate(Lang.Func4<? super P1,? super P2,? super P3,? super P4,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 3 parameters and returns boolean value
P1 - type of param oneP2 - type of param twoP3 - type of param threeP4 - type of param fourpredicate - the function applied to 2 params and return boolean valuepublic static <P1,P2,P3,P4,P5> Lang.F5<P1,P2,P3,P4,P5,Boolean> negate(Lang.Func5<? super P1,? super P2,? super P3,? super P4,? super P5,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 3 parameters and returns boolean value
P1 - type of param oneP2 - type of param twoP3 - type of param threeP4 - type of param fourP5 - type of param fivepredicate - the function applied to 2 params and return boolean valuepublic static <T> Lang.Val<T> provides(T obj)
Return a provider that when called will return the object specified
T - the object typeobj - the object to be returned when calling the returning functionpublic static <T> Lang.Predicate<T> yes()
A type-safe version of TRUE
T - the argument typetruepublic static <T> Lang.Predicate<T> no()
A type-safe version of FALSE
T - the argument typefalsepublic static <T> Lang.Predicate<T> isNull()
The type-safe version of IS_NULL
T - the argument typenull or NONEpublic static <T> Lang.Predicate<T> isNull(Class<T> c)
The type-safe version of IS_NULL
T - the argument typec - the class that specifies the argument typenull or NONEpublic static <T> Lang.Predicate<T> requireNotNull()
The type-safe version of NOT_NULL
T - the element typenull or NONEpublic static <T> Lang.F1<T,T> identity()
The type-safe version of IDENTITY
T - the element typepublic static <T> Lang.F1<T,T> identity(Class<T> clz)
The type-safe version of IDENTITY
T - the generic typeclz - the class that restrict the type of <T>public static <T extends Comparable<T>> Lang.F1<T,Boolean> lt(T v)
Returns a function that apply to one parameter and compare it with the value v specified, returns true if the parameter applied is less than v
T - the type of the value and parameterv - the value to be compare with the function parameterpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> lessThan(T v)
Alias of lt(Comparable)
T - the element typev - a value used to check against function argumentpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> gt(T v)
Returns a function that apply to one parameter and compare it with the value v specified, returns true if the parameter applied is greater than v
T - the type of the value and parameterv - the value to be compare with the function parameterpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> greaterThan(T v)
Alias of gt(Comparable)
T - the element typev - the value used to check against function argumentpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> gte(T v)
Returns a function that apply to one parameter and compare it with the value v specified, returns true if the parameter applied is greater than or equals to v
T - the type of the value and parameterv - the value to be compare with the function parameterpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> greaterThanOrEqualsTo(T v)
Alias of gte(Comparable)
T - the element typev - the value used to check against function argumentpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> lte(T v)
Returns a function that apply to one parameter and compare it with the value v specified, returns true if the parameter applied is less than or equals to v
T - the type of the value and parameterv - the value to be compare with the function parameterpublic static <T extends Comparable<T>> Lang.F1<T,Boolean> lessThanOrEqualsTo(T v)
Alias of lte(Comparable)
T - the element typev - the value to be used to check agains function arugmentpublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> lt()
Returns a function that check if a value is less than another one. This is the type safe version of LESS_THAN
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> lessThan()
Alias of lt()
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> lte()
Returns a function that check if a value is less than or equals to another one. This is the type safe version of LESS_THAN_OR_EQUAL_TO
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> lessThanOrEqualsTo()
Alias of lte()
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> gt()
Returns a function that check if a value is less than another one.
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> greaterThan()
Alias of gt()
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> gte()
Returns a function that check if a value is greater than or equals to another one. This is the type safe version of GREATER_THAN_OR_EQUAL_TO
T - The type of the value been compared, should implements Comparablepublic static <T extends Comparable<T>> Lang.F2<T,T,Boolean> greaterThanOrEqualsTo()
Alias of gte()
T - the element typepublic static <T> Lang.F2<T,T,Boolean> lt(Comparator<? super T> c)
Returns a function that check if a value is less than another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> lessThan(Comparator<? super T> c)
Alias of lt(java.util.Comparator)
T - element typec - a comparator functionc to check if an element is lesser than anotherpublic static <T> Lang.F2<T,T,Boolean> gt(Comparator<? super T> c)
Returns a function that check if a value is less than another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> greaterThan(Comparator<? super T> c)
Alias of gt(java.util.Comparator)
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> lte(Comparator<? super T> c)
Returns a function that check if a value is less than or equals to another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> lessThanOrEqualsTo(Comparator<? super T> c)
Alias of lte(java.util.Comparator)
T - the element typec - a comparator functionc to check if an element is lesser than or equals to anotherpublic static <T> Lang.F2<T,T,Boolean> gte(Comparator<? super T> c)
Returns a function that check if a value is greater than or equals to another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> greaterThanOrEqualsTo(Comparator<? super T> c)
Alias of gte(java.util.Comparator)
T - the element typec - a comparator functionc to check if an element is greater than or equals to anotherpublic static <T> Lang.F2<T,T,Boolean> lt(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> lessThan(Lang.Func2<? super T,? super T,Integer> c)
Alias of lt(java.util.Comparator)
T - the element typec - a comparator functionc to check if an element is lesser than anotherpublic static <T> Lang.F2<T,T,Boolean> gt(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> greaterThan(Lang.Func2<? super T,? super T,Integer> c)
Alias of gt(java.util.Comparator)
T - the element typec - a comparator functionc to check if an object is greater than anotherpublic static <T> Lang.F2<T,T,Boolean> lte(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than or equals to another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> lessThanOrEqualsTo(Lang.Func2<? super T,? super T,Integer> c)
Alias of lte(java.util.Comparator)
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> gte(Lang.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is greater than or equals to another one using the Comparator specified
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <T> Lang.F2<T,T,Boolean> greaterThanOrEqualsTo(Lang.Func2<? super T,? super T,Integer> c)
Alias of gte(java.util.Comparator)
T - The type of the value been compared, should implements Comparablec - The comparator that can compare the valuepublic static <P1,P2> Lang.F2<P1,P2,Boolean> eq()
The type-safe version of EQ
P1 - the type of the first argumentP2 - the type of the second argumentpublic static <P1,P2> Lang.F2<P1,P2,Boolean> equal()
Alias of eq()
P1 - the type of the first argumentP2 - the type of the second argumentpublic static <P> Lang.Predicate<P> eq(P element)
Returns a Lang.Predicate that checkes if the argument equals to the element specified
P - the element typeelement - the object to be checked with argument when applying the functiontrue if the argument equals with the element specified or false otherwisepublic static <P1,P2> Lang.F2<P1,P2,Boolean> ne()
The type-safe version of NE
P1 - type of the first argumentP2 - type of the second argumentNEpublic static <P1,P2> Lang.F2<P1,P2,Boolean> notEqual()
Alias of ne()
P1 - type of the first argumentP2 - type of the second argumentNEpublic static <T extends Comparable<T>> Lang.Comparator<T> naturalOrder()
public static <T extends Comparable<? super T>> Lang.Comparator<T> reverseOrder()
public static <T> Lang.Comparator<T> reverse(Comparator<? super T> c)
public static <T,U extends Comparable<? super U>> Lang.Comparator<T> comparing(Lang.Function<? super T,? extends U> keyExtractor)
public static <T,U> Lang.Comparator<T> comparing(Lang.Function<? super T,? extends U> keyExtractor, Comparator<? super U> keyComparator)
Construct a Comparator with a function to extract the key of type U from given object of type T and a comparator to compare type U
T - the type of the object instanceU - the type of the key extract from TkeyExtractor - the function to extract the key for comparisonkeyComparator - the Comparator that compares type U (the key type)public static <T> Lang.F1<T,Integer> hc()
The type-safe version of HASH_CODE
T - specifies the generic type of the argument passed to the returned functionF1<T, Integer> that takes type T argument and returns Object.hashCode() of the argumentpublic static <T> Lang.F1<T,String> asString()
A type-safe version of AS_STRING. It returns a function that takes argument of type T and returns a String by calling Object.toString() function on the argument
T - the generic type T of the returning functionF1<T, String>public static <T> Lang.F1<T,String> asString(Class<T> tClass)
Type safe version of AS_STRING. It returns a function that takes argument of type T and returns a String by calling Object.toString() function on the argument
T - the generic type T of the returning functiontClass - the class specify the generic typeF1<T, String>public static <BEAN> Lang.Transformer<BEAN,Object> propertyExtractor(String property)
public static Lang.Predicate<Field> fieldWithAnnotation(Class<? extends Annotation> annoClass)
Returns a predicate function that when applied to a Field type object, returns true if the field has specified annotation presented
annoClass - the annotationCopyright © 2014–2021 OSGL (Open Source General Library). All rights reserved.