Interface ContentTypeConverter<S,T>

Type Parameters:
S - The expected source type
T - The output type
All Known Implementing Classes:
BlobToInputStreamConverter, ByteArrayToGenericRecordConverter, ByteArrayToInputStreamConverter, ByteArrayToJsonNodeConverter, ByteArrayToJsonNodeConverter, ByteArrayToStringConverter, ChainedConverter, Dom4JToByteArrayConverter, GenericRecordToByteArrayConverter, InputStreamToByteArrayConverter, InputStreamToDom4jConverter, InputStreamToXomConverter, JsonNodeToByteArrayConverter, JsonNodeToByteArrayConverter, JsonNodeToObjectNodeConverter, JsonNodeToObjectNodeConverter, ObjectNodeToJsonNodeConverter, ObjectNodeToJsonNodeConverter, StringToByteArrayConverter, 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

    Modifier and Type
    Method
    Description
    convert(S original)
    Converts the given object into another.
    The expected type of input data.
    The returned type of IntermediateRepresentation
  • Method Details

    • 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

      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