|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.util.ValueHolder<T>
T - the type of the value@Immutable public abstract class ValueHolder<T>
A wrapper over an arbitrary type to be used by processors
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.
| Field Summary | |
|---|---|
protected static JsonNodeFactory |
FACTORY
|
protected T |
value
|
| Constructor Summary | |
|---|---|
protected |
ValueHolder(String name,
T value)
Protected constructor |
| Method Summary | ||
|---|---|---|
String |
getName()
Return the declared name for this value |
|
T |
getValue()
Get the value wrapped in the instance |
|
static
|
hold(String name,
V value)
|
|
static
|
hold(String name,
V value)
|
|
static
|
hold(V value)
|
|
static
|
hold(V value)
|
|
ProcessingMessage |
newMessage()
Create a new processing message template depending on the stored value |
|
protected abstract JsonNode |
valueAsJson()
Return a JSON representation of the value |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final JsonNodeFactory FACTORY
protected final T value
| Constructor Detail |
|---|
protected ValueHolder(String name,
T value)
name - the name to prefix the value withvalue - the value| Method Detail |
|---|
public static <V> ValueHolder<V> hold(V value)
public static <V> ValueHolder<V> hold(String name,
V value)
public static <V extends AsJson> ValueHolder<V> hold(V value)
public static <V extends AsJson> ValueHolder<V> hold(String name,
V value)
protected abstract JsonNode valueAsJson()
JsonNodepublic final String getName()
public final T getValue()
public final ProcessingMessage newMessage()
newMessage in interface MessageProviderProcessingMessage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||