@Test @DisplayName("not allow overwriting set route") void notOverwriteSetRoute() { eventRouting.route(UserRegistered.class, customRoute); assertThrows(IllegalStateException.class, () -> eventRouting.route(UserRegistered.class, customRoute)); }
@CanIgnoreReturnValue public <E extends EventMessage> EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<EventMessage, EventContext, Set<I>> casted = (Route<EventMessage, EventContext, Set<I>>) via; addRoute(eventType, casted); return this; }
EventRouting extends MessageRouting<EventMessage, EventContext, Set<I>> implements EventRoute<I, EventMessage> { @CanIgnoreReturnValue public <E extends EventMessage> EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<EventMessage, EventContext, Set<I>> casted = (Route<EventMessage, EventContext, Set<I>>) via; addRoute(eventType, casted); return this; } }
EventRouting extends MessageRouting<EventMessage, EventContext, Set<I>> implements EventRoute<I, EventMessage> { @CanIgnoreReturnValue public <E extends EventMessage> EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<EventMessage, EventContext, Set<I>> casted = (Route<EventMessage, EventContext, Set<I>>) via; addRoute(eventType, casted); return this; } private  EventRouting(EventRoute<I, EventMessage> defaultRoute); }
EventRouting extends MessageRouting<EventMessage, EventContext, Set<I>> implements EventRoute<I, EventMessage> { @CanIgnoreReturnValue public <E extends EventMessage> EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<EventMessage, EventContext, Set<I>> casted = (Route<EventMessage, EventContext, Set<I>>) via; addRoute(eventType, casted); return this; } private  EventRouting(EventRoute<I, EventMessage> defaultRoute); @CanIgnoreReturnValue static EventRouting<I> withDefault(EventRoute<I, EventMessage> defaultRoute); static EventRouting<I> withDefaultByProducerId(); @Override final EventRoute<I, EventMessage> defaultRoute(); @CanIgnoreReturnValue EventRouting<I> replaceDefault(EventRoute<I, EventMessage> newDefault); @CanIgnoreReturnValue EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via); @CanIgnoreReturnValue EventRouting<I> routeStateUpdates(StateUpdateRouting<I> routing); Optional<EventRoute<I, M>> get(Class<M> eventClass); }
EventRouting extends MessageRouting<EventMessage, EventContext, Set<I>> implements EventRoute<I, EventMessage> { @CanIgnoreReturnValue public <E extends EventMessage> EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<EventMessage, EventContext, Set<I>> casted = (Route<EventMessage, EventContext, Set<I>>) via; addRoute(eventType, casted); return this; } private  EventRouting(EventRoute<I, EventMessage> defaultRoute); @CanIgnoreReturnValue static EventRouting<I> withDefault(EventRoute<I, EventMessage> defaultRoute); static EventRouting<I> withDefaultByProducerId(); @Override final EventRoute<I, EventMessage> defaultRoute(); @CanIgnoreReturnValue EventRouting<I> replaceDefault(EventRoute<I, EventMessage> newDefault); @CanIgnoreReturnValue EventRouting<I> route(Class<E> eventType, EventRoute<I, ? super E> via); @CanIgnoreReturnValue EventRouting<I> routeStateUpdates(StateUpdateRouting<I> routing); Optional<EventRoute<I, M>> get(Class<M> eventClass);  }