Interface StateRebuildingHandler.FromObjectAndMetaDataAndSubject<I,E>

Type Parameters:
I - the instance type
E - the event type to be sourced
All Superinterfaces:
StateRebuildingHandler<I,E>
Enclosing interface:
StateRebuildingHandler<I,E>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static non-sealed interface StateRebuildingHandler.FromObjectAndMetaDataAndSubject<I,E> extends StateRebuildingHandler<I,E>
FunctionalInterface to be implemented, if the Java event, its meta-data, and subject is needed to reconstruct the instance state.
  • Method Details

    • on

      I on(I instance, E event, Map<String,?> metaData, String subject)
      Applies the given event, its meta-data, and subject to the given instance (state).
      Parameters:
      instance - the instance to apply the event to, may be null
      event - the event to apply
      metaData - the event meta-data, may be empty
      subject - the subject the event was published to
      Returns:
      an instance with the event, meta-data, and subject applied, ideally an immutable copy of the original instance