Class Procedures2
java.lang.Object
org.eclipse.collections.impl.block.factory.Procedures2
public final class Procedures2 extends Object
Contains factory methods for creating
Procedure2
instances.-
Field Summary
Fields Modifier and Type Field Description static Procedure2<?,?>
ADD_TO_COLLECTION
static Procedure2<?,?>
REMOVE_FROM_COLLECTION
-
Method Summary
Modifier and Type Method Description static <T> Procedure2<T,Collection<T>>
addToCollection()
static <T, P> Procedure2<T,P>
fromProcedure(Procedure<? super T> procedure)
static <T> Procedure2<T,Collection<T>>
removeFromCollection()
static <T> Procedure2<DoubleSummaryStatistics,T>
summarizeDouble(DoubleFunction<? super T> function)
static <T> Procedure2<DoubleSummaryStatistics,T>
summarizeFloat(FloatFunction<? super T> function)
static <T> Procedure2<IntSummaryStatistics,T>
summarizeInt(IntFunction<? super T> function)
static <T> Procedure2<LongSummaryStatistics,T>
summarizeLong(LongFunction<? super T> function)
static <T, P> Procedure2<T,P>
throwing(ThrowingProcedure2<T,P> throwingProcedure2)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Procedure2 that will throw a RuntimeException, wrapping the checked exception that is the cause.static <T1, T2> Procedure2<T1,T2>
throwing(ThrowingProcedure2<T1,T2> throwingProcedure, 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 Procedure2 that will throw a user specified RuntimeException based on the provided function.
-
Field Details
-
Method Details
-
throwing
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Procedure2 that will throw a RuntimeException, wrapping the checked exception that is the cause. -
throwing
public static <T1, T2> Procedure2<T1,T2> throwing(ThrowingProcedure2<T1,T2> throwingProcedure, 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 Procedure2 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. -
fromProcedure
-
addToCollection
-
removeFromCollection
-
summarizeDouble
public static <T> Procedure2<DoubleSummaryStatistics,T> summarizeDouble(DoubleFunction<? super T> function)- Since:
- 9.2.
-
summarizeFloat
public static <T> Procedure2<DoubleSummaryStatistics,T> summarizeFloat(FloatFunction<? super T> function)- Since:
- 9.2.
-
summarizeInt
public static <T> Procedure2<IntSummaryStatistics,T> summarizeInt(IntFunction<? super T> function)- Since:
- 9.2.
-
summarizeLong
public static <T> Procedure2<LongSummaryStatistics,T> summarizeLong(LongFunction<? super T> function)- Since:
- 9.2.
-