Package com.opencqrs.framework.upcaster
Class EventUpcasters
java.lang.Object
com.opencqrs.framework.upcaster.EventUpcasters
Implementation class delegating to a list of configurable
EventUpcaster
s combining the
EventUpcaster.Result
s 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 givenEvent
using all configuredEventUpcaster
s 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 causeOutOfMemoryError
if cyclically dependentEventUpcaster
s have been configured, for instance twoTypeChangingEventUpcaster
s switching types conversely.- Parameters:
event
- the event to be upcasted, if relevant- Returns:
- a stream of
Event
s withEvent.type()
andEvent.data()
upcasted as needed, all other attributes remain the same
-