|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValueSerializer
Use a ValueSerializer to serialize values state.
Serialized object must be one of:
Nested plain values, EntityReferences, Iterables, Maps, ValueComposites and EntityComposites are supported. EntityComposites and EntityReferences are serialized 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 serialized to
base64 encoded bytes using pure Java serialization. If it happens that the value is not Serializable, a
ValueSerializationException is thrown.
Having type information in the serialized payload allows to keep actual ValueComposite types and by so
circumvent AmbiguousTypeException
when deserializing.
Method Summary | ||
---|---|---|
|
serialize()
Factory method for a serialize function. |
|
|
serialize(boolean includeTypeInfo)
Factory method for a serialize function. |
|
java.lang.String |
serialize(java.lang.Object object)
Serialize the state of a value with type information. |
|
java.lang.String |
serialize(java.lang.Object object,
boolean includeTypeInfo)
Serialize the state of a value. |
|
void |
serialize(java.lang.Object object,
java.io.OutputStream output)
Serialize the state of a value with type information. |
|
void |
serialize(java.lang.Object object,
java.io.OutputStream output,
boolean includeTypeInfo)
Serialize the state of a value. |
Method Detail |
---|
<T> Function<T,java.lang.String> serialize()
T
- the parametrized function input type
<T> Function<T,java.lang.String> serialize(boolean includeTypeInfo)
T
- the parametrized function input typeincludeTypeInfo
- if type information should be included in the output
java.lang.String serialize(java.lang.Object object) throws ValueSerializationException
object
- an Object to serialize
ValueSerializationException
- if the Value serialization failedjava.lang.String serialize(java.lang.Object object, boolean includeTypeInfo) throws ValueSerializationException
object
- an Object to serializeincludeTypeInfo
- if type information should be included in the output
ValueSerializationException
- if the Value serialization failedvoid serialize(java.lang.Object object, java.io.OutputStream output) throws ValueSerializationException
object
- an Object to serializeoutput
- that will be used as output
ValueSerializationException
- if the Value serialization failedvoid serialize(java.lang.Object object, java.io.OutputStream output, boolean includeTypeInfo) throws ValueSerializationException
object
- an Object to serializeoutput
- that will be used as outputincludeTypeInfo
- if type information should be included in the output
ValueSerializationException
- if the Value serialization failed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |