T
- The data format that this upcaster uses to represent the eventpublic interface ExtendedUpcaster<T> extends Upcaster<T>
upcast(org.axonframework.serializer.SerializedType,
org.axonframework.serializer.SerializedObject)
on upcasters that implement this interface, instead of upcast(org.axonframework.serializer.SerializedType)
Modifier and Type | Method and Description |
---|---|
List<SerializedType> |
upcast(SerializedType serializedType)
Upcast the given
serializedType into its new format. |
List<SerializedType> |
upcast(SerializedType serializedType,
SerializedObject<T> intermediateRepresentation)
Upcast the given
serializedType into its new format. |
canUpcast, expectedRepresentationType, upcast
List<SerializedType> upcast(SerializedType serializedType, SerializedObject<T> intermediateRepresentation)
serializedType
into its new format. Generally, this involves increasing the
revision. Sometimes, it is also necessary to alter the type's name (in case of a renamed class, for example).
The order and the size of the list returned has to match with the order and size of the list of the upcast
IntermediateRepresentations by this upcaster.
Unlike the upcast(org.axonframework.serializer.SerializedType)
method, this gives you access to the
serialized object to upcast. This may be used to choose the SerializedType based on the contents of a Message's
payload.
Implementations aware of the ExtendedUpcaster interface must use this method instead of upcast(org.axonframework.serializer.SerializedType)
serializedType
- The serialized type to upcastintermediateRepresentation
- The intermediate representation of the object to define the type forList<SerializedType> upcast(SerializedType serializedType)
serializedType
into its new format. Generally, this involves increasing the
revision. Sometimes, it is also necessary to alter the type's name (in case of a renamed class, for example).
The order and the size of the list returned has to match with the order and size of the list of the upcast
IntermediateRepresentations by this upcaster.
To base the type on the actual contents of the Serialized Object, implement the ExtendedUpcaster
interface instead.
Implementing this method is optional.upcast
in interface Upcaster<T>
serializedType
- The serialized type to upcastUnsupportedOperationException
- if the implementation requires the intermediate representation
to upcast the serialized type.upcast(org.axonframework.serializer.SerializedType,
org.axonframework.serializer.SerializedObject)
Copyright © 2010-2014. All Rights Reserved.