Interface EventSerializer<AID extends AggregateId,E extends Event<AID>>
-
- Type Parameters:
AID- Aggregate ID type / 集約IDの型E- Event type / イベントの型
- All Known Implementing Classes:
JsonEventSerializer
public interface EventSerializer<AID extends AggregateId,E extends Event<AID>>This is an interface for serializing and deserializing events. / イベントのシリアライズとデシリアライズを行うためのインターフェース。
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Edeserialize(byte[] bytes, java.lang.Class<E> clazz)Deserializes the event.byte[]serialize(E event)Serializes the event.
-
-
-
Method Detail
-
serialize
@Nonnull byte[] serialize(@Nonnull E event) throws SerializationExceptionSerializes the event. / イベントをシリアライズします。- Parameters:
event- event / イベント- Returns:
- serialized event / シリアライズされたイベント
- Throws:
SerializationException- if an error occurred during serialization / シリアライズ中にエラーが発生した場合
-
deserialize
@Nonnull E deserialize(@Nonnull byte[] bytes, @Nonnull java.lang.Class<E> clazz) throws DeserializationException
Deserializes the event. / イベントをデシリアライズします。- Parameters:
bytes- bytes / バイト列clazz- class ofEventE to be deserialized / デシリアライズ対象のイベントEのクラス- Returns:
- deserialized event / デシリアライズされたイベント
- Throws:
DeserializationException- if an error occurred during deserialization / デシリアライズ中にエラーが発生した場合
-
-