org.axonframework.upcasting
Class UpcastSerializedDomainEventData<T>

java.lang.Object
  extended by org.axonframework.upcasting.UpcastSerializedDomainEventData<T>
Type Parameters:
T - The data type representing the serialized object
All Implemented Interfaces:
SerializedDomainEventData<T>

public class UpcastSerializedDomainEventData<T>
extends Object
implements SerializedDomainEventData<T>

SerializedDomainEventData implementation that can be used to duplicate existing SerializedDomainEventData instances after upcasting a payload.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
UpcastSerializedDomainEventData(SerializedDomainEventData<T> original, Object aggregateIdentifier, SerializedObject<T> upcastPayload)
          Reconstruct the given original SerializedDomainEventData replacing the aggregateIdentifier with given aggregateIdentifier and payload with upcastPayload.
 
Method Summary
 Object getAggregateIdentifier()
          Returns the Identifier of the Aggregate to which the Event was applied.
 String getEventIdentifier()
          Returns the identifier of the serialized event.
 SerializedObject<T> getMetaData()
          Returns the serialized data of the MetaData of the serialized Event.
 SerializedObject<T> getPayload()
          Returns the serialized data of the Event Message's payload.
 long getSequenceNumber()
          Returns the sequence number of the event in the aggregate.
 org.joda.time.DateTime getTimestamp()
          Returns the timestamp at which the event was first created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpcastSerializedDomainEventData

public UpcastSerializedDomainEventData(SerializedDomainEventData<T> original,
                                       Object aggregateIdentifier,
                                       SerializedObject<T> upcastPayload)
Reconstruct the given original SerializedDomainEventData replacing the aggregateIdentifier with given aggregateIdentifier and payload with upcastPayload. Typically, for each payload instance returned after an upcast, a single UpcastSerializedDomainEventData instance is to be created.

Parameters:
original - The original SerializedDomainEventData instance
aggregateIdentifier - The aggregate identifier instance
upcastPayload - The replacement payload
Method Detail

getEventIdentifier

public String getEventIdentifier()
Description copied from interface: SerializedDomainEventData
Returns the identifier of the serialized event.

Specified by:
getEventIdentifier in interface SerializedDomainEventData<T>
Returns:
the identifier of the serialized event

getAggregateIdentifier

public Object getAggregateIdentifier()
Description copied from interface: SerializedDomainEventData
Returns the Identifier of the Aggregate to which the Event was applied.

Specified by:
getAggregateIdentifier in interface SerializedDomainEventData<T>
Returns:
the Identifier of the Aggregate to which the Event was applied

getSequenceNumber

public long getSequenceNumber()
Description copied from interface: SerializedDomainEventData
Returns the sequence number of the event in the aggregate.

Specified by:
getSequenceNumber in interface SerializedDomainEventData<T>
Returns:
the sequence number of the event in the aggregate

getTimestamp

public org.joda.time.DateTime getTimestamp()
Description copied from interface: SerializedDomainEventData
Returns the timestamp at which the event was first created.

Specified by:
getTimestamp in interface SerializedDomainEventData<T>
Returns:
the timestamp at which the event was first created

getMetaData

public SerializedObject<T> getMetaData()
Description copied from interface: SerializedDomainEventData
Returns the serialized data of the MetaData of the serialized Event.

Specified by:
getMetaData in interface SerializedDomainEventData<T>
Returns:
the serialized data of the MetaData of the serialized Event

getPayload

public SerializedObject<T> getPayload()
Description copied from interface: SerializedDomainEventData
Returns the serialized data of the Event Message's payload.

Specified by:
getPayload in interface SerializedDomainEventData<T>
Returns:
the serialized data of the Event Message's payload


Copyright © 2010-2016. All Rights Reserved.