public interface ValueDeserializer
Serialized state must be one of:
Nested plain values, EntityReferences, Collections, Maps, ValueComposites are supported. EntityReferences are deserialized as their identity string.
Plain values can be one of:
Values of unknown types and all arrays are considered as Serializable
and by so are deserialized
from base64 encoded bytes using pure Java serialization. If it happens that the input is invalid, a
ValueSerializationException is thrown.
Having type information in the serialized payload allows to keep actual ValueComposite types and by so
circumvent AmbiguousTypeException
when deserializing.
Modifier and Type | Method and Description |
---|---|
<T> Function2<ValueType,String,T> |
deserialize()
Factory method for an untyped deserialize function.
|
<T> T |
deserialize(Class<?> type,
InputStream input)
Deserialize a value from a state.
|
<T> T |
deserialize(Class<?> type,
String input)
Deserialize a value from a state.
|
<T> Function<String,T> |
deserialize(Class<T> type)
Factory method for a typed deserialize function.
|
<T> Function<String,T> |
deserialize(ValueType valueType)
Factory method for a typed deserialize function.
|
<T> T |
deserialize(ValueType valueType,
InputStream input)
Deserialize a value from a state.
|
<T> T |
deserialize(ValueType valueType,
String input)
Deserialize a value from a state.
|
<T> Function<String,T> deserialize(Class<T> type)
The returned Function may throw ValueSerializationException
.
T
- the parametrized function return typetype
- the value type<T> Function<String,T> deserialize(ValueType valueType)
The returned Function may throw ValueSerializationException
.
T
- the parametrized function return typevalueType
- the value type<T> Function2<ValueType,String,T> deserialize()
The returned Function may throw ValueSerializationException
.
T
- the parametrized function return type<T> T deserialize(Class<?> type, String input) throws ValueSerializationException
T
- the parametrized returned typetype
- the value typeinput
- the stateValueSerializationException
- if the deserialization failed<T> T deserialize(ValueType valueType, String input) throws ValueSerializationException
T
- the parametrized returned typevalueType
- the value typeinput
- the stateValueSerializationException
- if the deserialization failed<T> T deserialize(Class<?> type, InputStream input) throws ValueSerializationException
T
- the parametrized returned typetype
- the value typeinput
- the state streamValueSerializationException
- if the deserialization failed<T> T deserialize(ValueType valueType, InputStream input) throws ValueSerializationException
T
- the parametrized returned typevalueType
- the value typeinput
- the state streamValueSerializationException
- if the deserialization failed