Class Functions2
java.lang.Object
org.eclipse.collections.impl.block.factory.Functions2
Contains factory methods for creating
Function2
instances.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
V, P> Function2<T, P, V> fromFunction
(Function<? super T, ? extends V> function) static <T> Function2<T,
T, T> max
(Comparator<? super T> comparator) static <T,
V extends Comparable<? super V>>
Function2<T,T, T> static <T> Function2<T,
T, T> min
(Comparator<? super T> comparator) static <T,
V extends Comparable<? super V>>
Function2<T,T, T> static <T,
V, P> Function2<T, P, V> throwing
(ThrowingFunction2<T, P, V> throwingFunction2) Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a RuntimeException, wrapping the checked exception that is the cause.static <T1,
T2, V> Function2<T1, T2, V> throwing
(ThrowingFunction2<T1, T2, V> throwingFunction2, Function3<T1, T2, ? super Throwable, ? extends RuntimeException> rethrow) Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a user specified RuntimeException based on the provided function.
-
Method Details
-
fromFunction
-
throwing
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a RuntimeException, wrapping the checked exception that is the cause. -
throwing
public static <T1,T2, Function2<T1,V> T2, throwingV> (ThrowingFunction2<T1, T2, V> throwingFunction2, Function3<T1, T2, ? super Throwable, ? extends RuntimeException> rethrow) Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Function2 that will throw a user specified RuntimeException based on the provided function. The function is passed the current element and the checked exception that was thrown as context arguments. -
integerAddition
-
min
-
max
-
minBy
public static <T,V extends Comparable<? super V>> Function2<T,T, minByT> (Function<? super T, ? extends V> function) -
maxBy
public static <T,V extends Comparable<? super V>> Function2<T,T, maxByT> (Function<? super T, ? extends V> function)
-