Class Procedures2
- java.lang.Object
-
- org.eclipse.collections.impl.block.factory.Procedures2
-
public final class Procedures2 extends Object
Contains factory methods for creatingProcedure2instances.
-
-
Field Summary
Fields Modifier and Type Field Description static Procedure2<?,?>ADD_TO_COLLECTIONstatic Procedure2<?,?>REMOVE_FROM_COLLECTION
-
Method Summary
All Methods Static Methods Concrete Methods 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 Detail
-
ADD_TO_COLLECTION
public static final Procedure2<?,?> ADD_TO_COLLECTION
-
REMOVE_FROM_COLLECTION
public static final Procedure2<?,?> REMOVE_FROM_COLLECTION
-
-
Method Detail
-
throwing
public 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.
-
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
public static <T,P> Procedure2<T,P> fromProcedure(Procedure<? super T> procedure)
-
addToCollection
public static <T> Procedure2<T,Collection<T>> addToCollection()
-
removeFromCollection
public static <T> Procedure2<T,Collection<T>> 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.
-
-