Package org.wildfly.clustering.function
Interface Consumer<T>
- Type Parameters:
T- the accepted type
- All Superinterfaces:
Consumer<T>
- All Known Implementing Classes:
SimpleDataOutput.ArrayConsumer,SimpleDataOutput.GenericArrayConsumer
An enhanced unary consumer.
- Author:
- Paul Ferraro
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <V extends AutoCloseable>
Consumer<V>close()Returns a consumer that performs no action.static <V> Consumer<V>empty()Returns a consumer that performs no action.default <V> Consumer<V>Returns a mapped consumer, that invokes this consumer using result of the specified function.static <V> Consumer<V>Returns a composite consumer that delegates to zero or more consumers.static <V> Consumer<V>Returns a consumer that runs the specified task, ignoring its parameter.
-
Field Details
-
EMPTY
-
CLOSE
-
-
Method Details
-
andThen
-
map
Returns a mapped consumer, that invokes this consumer using result of the specified function.- Type Parameters:
V- the mapped type- Parameters:
mapper- a mapping function- Returns:
- a mapped consumer
-
empty
Returns a consumer that performs no action.- Type Parameters:
V- the consumed type- Returns:
- an empty consumer
-
close
Returns a consumer that performs no action.- Type Parameters:
V- the consumed type- Returns:
- an empty consumer
-
of
Returns a consumer that runs the specified task, ignoring its parameter.- Type Parameters:
V- the ignored parameter type- Parameters:
task- a runnable task- Returns:
- a consumer that runs the specified task, ignoring its parameter.
-
of
Returns a composite consumer that delegates to zero or more consumers.- Type Parameters:
V- the consumed type- Parameters:
consumers- zero or more consumers- Returns:
- a composite consumer
-