T - the type of the value@Immutable public abstract class ValueHolder<T> extends Object implements MessageProvider
Since all inputs and outputs of a Processor need to implement
MessageProvider, this abstract class helps to wrap values and
implement this interface at the same time.
Implementations need only implement the valueAsJson() method.
| Modifier and Type | Field and Description |
|---|---|
protected static JsonNodeFactory |
FACTORY |
protected T |
value |
| Modifier | Constructor and Description |
|---|---|
protected |
ValueHolder(String name,
T value)
Protected constructor
|
| Modifier and Type | Method and Description |
|---|---|
T |
getValue()
Get the value wrapped in the instance
|
ProcessingMessage |
newMessage()
Create a new processing message template depending on the stored value
|
protected abstract JsonNode |
valueAsJson()
Return a JSON representation of the value
|
protected static final JsonNodeFactory FACTORY
protected final T value
protected abstract JsonNode valueAsJson()
JsonNodepublic final T getValue()
public final ProcessingMessage newMessage()
newMessage in interface MessageProviderProcessingMessageCopyright © 2013. All Rights Reserved.