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 Detail

      • serialize

        @Nonnull
        byte[] serialize​(@Nonnull
                         E event)
                  throws SerializationException
        Serializes 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 of Event E to be deserialized / デシリアライズ対象のイベントEのクラス
        Returns:
        deserialized event / デシリアライズされたイベント
        Throws:
        DeserializationException - if an error occurred during deserialization / デシリアライズ中にエラーが発生した場合