Input - type of object consumedOutput - output of the transformation, which is the input of the embedded consumerpublic abstract class ProductTransformation<Input,Output> extends Object implements Consumer<Input>
| Constructor and Description |
|---|
ProductTransformation(Consumer<Output> consumer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(CancelException event)
Cancel and stop consumption.
|
AsyncSupplier<?,? extends Exception> |
consume(Input product)
Consume the given object.
|
AsyncSupplier<?,? extends Exception> |
endOfProduction()
Signal the end of production, meaning no new object will be given to consume.
|
void |
error(Exception error)
Signal an error and stop consumption.
|
protected abstract AsyncSupplier<Output,Exception> |
process(Input input) |
public AsyncSupplier<?,? extends Exception> consume(Input product)
Consumerprotected abstract AsyncSupplier<Output,Exception> process(Input input)
public void cancel(CancelException event)
Consumerpublic void error(Exception error)
Consumerpublic AsyncSupplier<?,? extends Exception> endOfProduction()
ConsumerendOfProduction in interface Consumer<Input>Copyright © 2019. All rights reserved.