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.
|
AsyncWork<?,? extends Exception> |
consume(Input product)
Consume the given object.
|
AsyncWork<?,? 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 AsyncWork<Output,Exception> |
process(Input input) |
public AsyncWork<?,? extends Exception> consume(Input product)
Consumerpublic void cancel(CancelException event)
Consumerpublic void error(Exception error)
ConsumerCopyright © 2017. All rights reserved.