Package org.axonframework.conversion
Interface Converter
- All Superinterfaces:
DescribableComponent
- All Known Subinterfaces:
EventConverter,MessageConverter
- All Known Implementing Classes:
AvroConverter,ChainingContentTypeConverter,DelegatingEventConverter,DelegatingMessageConverter,JacksonConverter,PassThroughConverter
Interface describing a mechanism that can convert data from one to another type.
Used when object are added/retrieved from a storage solution or put on/received from a network. Clear example of this
is the
.invalid reference
org.axonframework.messaging.Message
- Since:
- 3.0.0
- Author:
- Allard Buijze, Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanConvert(Class<?> sourceType, Class<?> targetType) Indicates whether thisConverteris capable of converting the givensourceTypeto thetargetType.booleancanConvert(Type sourceType, Type targetType) Indicates whether thisConverteris capable of converting the givensourceTypeto thetargetType.default <T> TConverts the giveninputobject into an object of the giventargetType.<T> TConverts the giveninputobject into an object of the giventargetType.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
canConvert
Indicates whether thisConverteris capable of converting the givensourceTypeto thetargetType.- Parameters:
sourceType- The type of data to convert from.targetType- The type of data to convert to.- Returns:
trueif conversion is possible,falseotherwise.
-
canConvert
Indicates whether thisConverteris capable of converting the givensourceTypeto thetargetType.- Parameters:
sourceType- The type of data to convert from.targetType- The type of data to convert to.- Returns:
trueif conversion is possible,falseotherwise.
-
convert
Converts the giveninputobject into an object of the giventargetType.- Type Parameters:
T- The target data type.- Parameters:
input- The value to convert.targetType- The type to convert the giveninputinto.- Returns:
- A converted version of the given
inputinto the giventargetType.
-
convert
Converts the giveninputobject into an object of the giventargetType.- Type Parameters:
T- The target data type.- Parameters:
input- The value to convert.targetType- The type to convert the giveninputinto.- Returns:
- A converted version of the given
inputinto the giventargetType.
-