org.axonframework.eventstore
Interface EventSerializer

All Known Implementing Classes:
XStreamEventSerializer

public interface EventSerializer

Interface describing classes that can serialize and deserialize DomainEvents to bytes.

Since:
0.5
Author:
Allard Buijze

Method Summary
 DomainEvent deserialize(byte[] serializedEvent)
          Deserialize a DomainEvent using the given serializedEvents.
 byte[] serialize(DomainEvent event)
          Serialize the given events into a byte[].
 

Method Detail

serialize

byte[] serialize(DomainEvent event)
Serialize the given events into a byte[]. The actual encoding used depends on the implementation.

Parameters:
event - The event to serialize
Returns:
the byte array representing the serialized domain event.

deserialize

DomainEvent deserialize(byte[] serializedEvent)
Deserialize a DomainEvent using the given serializedEvents. Implementations are *not* allowed to change the given serializedEvent (byte array).

Parameters:
serializedEvent - The byte array containing the serialized domain event.
Returns:
The DomainEvent instance represented by the provided byte array


Copyright © 2011. All Rights Reserved.