Class Procedures2
java.lang.Object
org.eclipse.collections.impl.block.factory.Procedures2
Contains factory methods for creating
Procedure2
instances.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Procedure2<T,
Collection<T>> static <T,
P> Procedure2<T, P> fromProcedure
(Procedure<? super T> procedure) static <T> Procedure2<T,
Collection<T>> 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
-
ADD_TO_COLLECTION
-
REMOVE_FROM_COLLECTION
-
-
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
- Since:
- 9.2.
-
summarizeLong
public static <T> Procedure2<LongSummaryStatistics,T> summarizeLong(LongFunction<? super T> function) - Since:
- 9.2.
-