Interface SnapshotAdapter<State>

  • Type Parameters:
    State - The state type of the EventSourcedBehavior
    All Known Implementing Classes:
    NoOpSnapshotAdapter

    public interface SnapshotAdapter<State>
    Facility to convert snapshots from and to a specialized data model. Can be used when migration from different state types e.g. when migration from Persistent FSM to Typed EventSourcedBehavior.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      State fromJournal​(java.lang.Object from)
      Transform the stored state into the current state type.
      java.lang.Object toJournal​(State state)
      Transform the state to a different type before sending to the journal.
    • Method Detail

      • fromJournal

        State fromJournal​(java.lang.Object from)
        Transform the stored state into the current state type. Can be used for migrations from different serialized state types.
      • toJournal

        java.lang.Object toJournal​(State state)
        Transform the state to a different type before sending to the journal.