Package org.axonframework.conversion
Interface Converter
- All Superinterfaces:
DescribableComponent
- All Known Subinterfaces:
EventConverter,MessageConverter
- All Known Implementing Classes:
AvroConverter,ChainingContentTypeConverter,DelegatingEventConverter,DelegatingMessageConverter,Jackson2Converter,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 org.axonframework.messaging.core.Message.
- Since:
- 3.0.0
- Author:
- Allard Buijze, Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> @Nullable TConverts the giveninputobject into an object of the giventargetType.<T> @Nullable TConverts the giveninputobject into an object of the giventargetType.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
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. - Throws:
ConversionException- If theinputcannot be converted to 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. - Throws:
ConversionException- If theinputcannot be converted to the giventargetType.
-