public interface Transformer<K,L>
AttributeStorage as an
external state storage. Please note, that AttributeStorage is being passed as the parameter to all
Transformer methods. This way it's possible to reuse single instance of a stateful Transformer to
process lots of concurrent transformations.| Modifier and Type | Method and Description |
|---|---|
TransformationResult<K,L> |
getLastResult(AttributeStorage storage)
Gets the last returned Transformer result.
|
String |
getName()
Get the Transformer name.
|
boolean |
hasInputRemaining(AttributeStorage storage,
K input) |
void |
release(AttributeStorage storage)
The Transformer has done its work and can release all associated resource.
|
TransformationResult<K,L> |
transform(AttributeStorage storage,
K input)
Transforms an input data to some custom representation.
|
String getName()
TransformationResult<K,L> transform(AttributeStorage storage, K input) throws TransformationException
AttributeStorage).storage - the external state storage, where Transformer could get/put a state.input - data to transformTransformationResultTransformationException - if failed to transport i.e. invalid typesTransformationResult<K,L> getLastResult(AttributeStorage storage)
storage - the external state storage, where Transformer could retrieve or store its state.void release(AttributeStorage storage)
storage - the external state storage, where Transformer could retrieve or store its state.boolean hasInputRemaining(AttributeStorage storage, K input)
Copyright © 2017–2020 Oracle Corporation. All rights reserved.