Package org.axonframework.serialization
Interface Converter
- All Known Implementing Classes:
ChainingConverter
public interface Converter
Interface describing a mechanism that can convert data from one to another type.
- Author:
- Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class<?> sourceType, Class<?> targetType) Indicates whether this converter is capable of converting the givensourceTypeto thetargetType.<T> TConverts the given object into another using the source type to find the conversion path.default <T> TConverts the given object into another.default <T> SerializedObject<T> convert(SerializedObject<?> original, Class<T> targetType) Converts the data format of the givenoriginalIntermediateRepresentation to the target data type.
-
Method Details
-
canConvert
Indicates whether this converter is capable of converting the givensourceTypeto thetargetType.- Parameters:
sourceType- The type of data to convert fromtargetType- The type of data to convert to- Returns:
trueif conversion is possible,falseotherwise
-
convert
Converts the given object into another.- Type Parameters:
T- the target data type- Parameters:
original- the value to converttargetType- The type of data to convert to- Returns:
- the converted value
-
convert
Converts the given object into another using the source type to find the conversion path.- Type Parameters:
T- the target data type- Parameters:
original- the value to convertsourceType- the type of data to converttargetType- The type of data to convert to- Returns:
- the converted value
-
convert
Converts the data format of the givenoriginalIntermediateRepresentation to the target data type.- Type Parameters:
T- the target data type- Parameters:
original- The source to converttargetType- The type of data to convert to- Returns:
- the converted representation
-