org.axonframework.serializer
Interface ContentTypeConverter<S,T>

Type Parameters:
S - The expected source type
T - The output type
All Known Implementing Classes:
AbstractContentTypeConverter, BlobToInputStreamConverter, ByteArrayToInputStreamConverter, ByteArrayToJsonNodeConverter, ByteArrayToStringConverter, ChainedConverter, DBObjectToStringContentTypeConverter, DBObjectToStringContentTypeConverter, Dom4JToByteArrayConverter, InputStreamToByteArrayConverter, InputStreamToDom4jConverter, InputStreamToXomConverter, JsonNodeToByteArrayConverter, StringToByteArrayConverter, StringToDBObjectContentTypeConverter, StringToDBObjectContentTypeConverter, XomToStringConverter

public interface ContentTypeConverter<S,T>

Interface describing a mechanism that converts the data type of IntermediateRepresentations of SerializedObjects for Upcasters. Different upcasters may require different data type (e.g. byte[] or InputStream), or may produce a different data type than they consume.

Since:
2.0
Author:
Allard Buijze

Method Summary
 T convert(S original)
          Converts the given object into another.
 SerializedObject<T> convert(SerializedObject<S> original)
          Converts the data format of the given original IntermediateRepresentation to the target data type.
 Class<S> expectedSourceType()
          The expected type of input data.
 Class<T> targetType()
          The returned type of IntermediateRepresentation
 

Method Detail

expectedSourceType

Class<S> expectedSourceType()
The expected type of input data.

Returns:
the expected data format in IntermediateRepresentation

targetType

Class<T> targetType()
The returned type of IntermediateRepresentation

Returns:
the output data format in IntermediateRepresentation

convert

SerializedObject<T> convert(SerializedObject<S> original)
Converts the data format of the given original IntermediateRepresentation to the target data type.

Parameters:
original - The source to convert
Returns:
the converted representation

convert

T convert(S original)
Converts the given object into another. Typically, these values are contained by a SerializedObject instance.

Parameters:
original - the value to convert
Returns:
the converted value


Copyright © 2010-2016. All Rights Reserved.