Package org.n52.janmayen.function
Class Consumers
java.lang.Object
org.n52.janmayen.function.Consumers
Utility functions for
Consumer.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U> Consumer <U> curryFirst(BiConsumer<T, U> consumer, T t) Curries the second parameter of theBiConsumerand creates aConsumer.static <T,U> Consumer <T> currySecond(BiConsumer<T, U> consumer, U u) Curries the second parameter of theBiConsumerand creates aConsumer.static <A,B> BiConsumer <B, A> reverse(BiConsumer<A, B> consumer) Reverses the parameter order of the BiConsumer
-
Method Details
-
curryFirst
Curries the second parameter of theBiConsumerand creates aConsumer.- Type Parameters:
T- the first parameter typeU- the second parameter type- Parameters:
consumer- the consumert- the curried parameter- Returns:
- the curried consumer
-
currySecond
Curries the second parameter of theBiConsumerand creates aConsumer.- Type Parameters:
T- the first parameter typeU- the second parameter type- Parameters:
consumer- the consumeru- the curried parameter- Returns:
- the curried consumer
-
reverse
Reverses the parameter order of the BiConsumer- Type Parameters:
A- the first parameter typeB- the second parameter type- Parameters:
consumer- the consumer- Returns:
- the consumer with switched parameters
-