Class EventUpcasters

java.lang.Object
com.opencqrs.framework.upcaster.EventUpcasters

public class EventUpcasters extends Object
Implementation class delegating to a list of configurable EventUpcasters combining the EventUpcaster.Results appropriately.
See Also:
  • Constructor Details

  • Method Details

    • upcast

      public Stream<Event> upcast(Event event)
      If necessary upcasts the given Event using all configured EventUpcasters repeatedly, as long as one of them is capable of upcasting the event. The given event, hence, will be upcasted using a chain of upcasters, as long as necessary. Due to non-deferred stream population be aware, that this method will block infinitely or cause OutOfMemoryError if cyclically dependent EventUpcasters have been configured, for instance two TypeChangingEventUpcasters switching types conversely.
      Parameters:
      event - the event to be upcasted, if relevant
      Returns:
      a stream of Events with Event.type() and Event.data() upcasted as needed, all other attributes remain the same