Interface SnapshotSerializer<AID extends AggregateId,​A extends Aggregate<A,​AID>>

  • Type Parameters:
    AID - Aggregate ID type / 集約IDの型
    A - Aggregate type / 集約の型
    All Known Implementing Classes:
    JsonSnapshotSerializer

    public interface SnapshotSerializer<AID extends AggregateId,​A extends Aggregate<A,​AID>>
    This is an interface for serializing and deserializing snapshots. / スナップショットのシリアライズとデシリアライズを行うためのインターフェース。
    • Method Detail

      • serialize

        @Nonnull
        byte[] serialize​(@Nonnull
                         A snapshot)
                  throws SerializationException
        Serializes the snapshot. / スナップショットをシリアライズします。
        Parameters:
        snapshot - snapshot / スナップショット
        Returns:
        serialized snapshot / シリアライズされたスナップショット
        Throws:
        SerializationException - if an error occurred during serialization / シリアライズ中にエラーが発生した場合
      • deserialize

        @Nonnull
        A deserialize​(@Nonnull
                      byte[] bytes,
                      @Nonnull
                      java.lang.Class<A> clazz)
               throws DeserializationException
        Deserializes the snapshot. / スナップショットをデシリアライズします。
        Parameters:
        bytes - bytes / バイト列
        clazz - class of Aggregate A to be deserialized / デシリアライズ対象の集約Aのクラス
        Returns:
        deserialized snapshot / デシリアライズされたスナップショット
        Throws:
        DeserializationException - if an error occurred during deserialization / デシリアライズ中にエラーが発生した場合