Class DefaultSnapshotSerializer<AID extends AggregateId,A extends Aggregate<A,AID>>
- java.lang.Object
-
- com.github.j5ik2o.event.store.adapter.java.DefaultSnapshotSerializer<AID,A>
-
- All Implemented Interfaces:
SnapshotSerializer<AID,A>
public final class DefaultSnapshotSerializer<AID extends AggregateId,A extends Aggregate<A,AID>> extends java.lang.Object implements SnapshotSerializer<AID,A>
-
-
Constructor Summary
Constructors Constructor Description DefaultSnapshotSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Adeserialize(byte[] bytes, java.lang.Class<A> clazz)Deserializes the snapshot.byte[]serialize(A snapshot)Serializes the snapshot.
-
-
-
Method Detail
-
serialize
@Nonnull public byte[] serialize(@Nonnull A snapshot) throws SerializationExceptionDescription copied from interface:SnapshotSerializerSerializes the snapshot. / スナップショットをシリアライズします。- Specified by:
serializein interfaceSnapshotSerializer<AID extends AggregateId,A extends Aggregate<A,AID>>- Parameters:
snapshot- snapshot / スナップショット- Returns:
- serialized snapshot / シリアライズされたスナップショット
- Throws:
SerializationException- if an error occurred during serialization / シリアライズ中にエラーが発生した場合
-
deserialize
@Nonnull public A deserialize(@Nonnull byte[] bytes, @Nonnull java.lang.Class<A> clazz) throws DeserializationException
Description copied from interface:SnapshotSerializerDeserializes the snapshot. / スナップショットをデシリアライズします。- Specified by:
deserializein interfaceSnapshotSerializer<AID extends AggregateId,A extends Aggregate<A,AID>>- Parameters:
bytes- bytes / バイト列clazz- class ofAggregateA to be deserialized / デシリアライズ対象の集約Aのクラス- Returns:
- deserialized snapshot / デシリアライズされたスナップショット
- Throws:
DeserializationException- if an error occurred during deserialization / デシリアライズ中にエラーが発生した場合
-
-