org.axonframework.eventstore
Interface EventUpcaster<T>

Type Parameters:
T - The data format that this upcaster uses to represent the event
All Known Implementing Classes:
LegacyAxonEventUpcaster

public interface EventUpcaster<T>

Interface for Upcasters. An upcaster is the mechanism used to convert deprecated (typically serialized) events from the eventstore and convert them into the current format. If the serializer itself is not able to cope with the changed formats (XStream, for example, will allow for some changes by using aliases), the Upcaster will allow you to configure more complex structural transformations.

Since:
0.7
Author:
Allard Buijze

Method Summary
 Class<T> getSupportedRepresentation()
          Since Java's generics are erased, this method allows serializers to verify the supported event representation of this upcaster.
 T upcast(T event)
          Upcast the given event to make it parsable by the EventSerializer.
 

Method Detail

getSupportedRepresentation

Class<T> getSupportedRepresentation()
Since Java's generics are erased, this method allows serializers to verify the supported event representation of this upcaster. Serializers may support any number of formats, and are responsible for the transformation between them if they accept more than one.

Returns:
The type of representation supported by this upcaster

upcast

T upcast(T event)
Upcast the given event to make it parsable by the EventSerializer. Implementations may alter the given event, and return a reference to the same instance.

Parameters:
event - The serialized event. This instance may have been processed by other upcasters.
Returns:
The instance to use for further upcasting or deserialization


Copyright © 2011. All Rights Reserved.