Package com.opencqrs.framework.upcaster
Class EventUpcasters
java.lang.Object
com.opencqrs.framework.upcaster.EventUpcasters
Implementation class delegating to a list of configurable
EventUpcasters combining the
EventUpcaster.Results appropriately.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEventUpcasters(EventUpcaster... upcasters) EventUpcasters(List<EventUpcaster> upcasters) -
Method Summary
-
Constructor Details
-
EventUpcasters
-
EventUpcasters
-
-
Method Details
-
upcast
If necessary upcasts the givenEventusing all configuredEventUpcasters 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 causeOutOfMemoryErrorif cyclically dependentEventUpcasters have been configured, for instance twoTypeChangingEventUpcasters switching types conversely.- Parameters:
event- the event to be upcasted, if relevant- Returns:
- a stream of
Events withEvent.type()andEvent.data()upcasted as needed, all other attributes remain the same
-