/** * Constructs a new SagaEntry for the given {@code saga}. The given saga must be serializable. The * provided saga is not modified by this operation. * * @param saga The saga to store * @param serializer The serialization mechanism to convert the Saga to a byte stream */ public SagaEntry(T saga, String sagaIdentifier, Serializer serializer) { this.sagaId = sagaIdentifier; SerializedObject<byte[]> serialized = serializer.serialize(saga, byte[].class); this.serializedSaga = serialized.getData(); this.sagaType = serialized.getType().getName(); this.revision = serialized.getType().getRevision(); }