Package com.opencqrs.framework.upcaster
Class NoEventUpcaster
java.lang.Object
com.opencqrs.framework.upcaster.NoEventUpcaster
- All Implemented Interfaces:
EventUpcaster
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.opencqrs.framework.upcaster.EventUpcaster
EventUpcaster.Result
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines ifthis
upcaster is relevant for upcasting the givenEvent
.Upcasts the given event to a stream ofEventUpcaster.Result
s.
-
Constructor Details
-
NoEventUpcaster
-
-
Method Details
-
canUpcast
Description copied from interface:EventUpcaster
Determines ifthis
upcaster is relevant for upcasting the givenEvent
. This method must be called prior toEventUpcaster.upcast(Event)
.- Specified by:
canUpcast
in interfaceEventUpcaster
- Parameters:
event
- the event that may need to be upcasted- Returns:
true
ifthis
can upcast the event,false
otherwise
-
upcast
Description copied from interface:EventUpcaster
Upcasts the given event to a stream ofEventUpcaster.Result
s. This allows implementations to:- effectively drop an event by returning an empty stream
- upcast an event to one new event by returning a single element stream
- effectively split up an event by returning a multi element stream
- Specified by:
upcast
in interfaceEventUpcaster
- Parameters:
event
- the event to be upcasted- Returns:
- a stream of
EventUpcaster.Result
s carrying the upcastedEvent.type()
andEvent.data()
-