@Test @DisplayName("remove previously set route") void removePreviouslySetRoute() { commandRouting.route(RegisterUser.class, customRoute); commandRouting.remove(RegisterUser.class); }
@CanIgnoreReturnValue public <M extends CommandMessage> CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<CommandMessage, CommandContext, I> casted = (Route<CommandMessage, CommandContext, I>) via; addRoute(commandType, casted); return this; }
CommandRouting extends MessageRouting<CommandMessage, CommandContext, I> { @CanIgnoreReturnValue public <M extends CommandMessage> CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<CommandMessage, CommandContext, I> casted = (Route<CommandMessage, CommandContext, I>) via; addRoute(commandType, casted); return this; } }
CommandRouting extends MessageRouting<CommandMessage, CommandContext, I> { @CanIgnoreReturnValue public <M extends CommandMessage> CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<CommandMessage, CommandContext, I> casted = (Route<CommandMessage, CommandContext, I>) via; addRoute(commandType, casted); return this; } private  CommandRouting(CommandRoute<I, CommandMessage> defaultRoute); }
CommandRouting extends MessageRouting<CommandMessage, CommandContext, I> { @CanIgnoreReturnValue public <M extends CommandMessage> CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<CommandMessage, CommandContext, I> casted = (Route<CommandMessage, CommandContext, I>) via; addRoute(commandType, casted); return this; } private  CommandRouting(CommandRoute<I, CommandMessage> defaultRoute); static CommandRouting<I> newInstance(Class<I> idClass); @Override final CommandRoute<I, CommandMessage> defaultRoute(); @CanIgnoreReturnValue CommandRouting<I> replaceDefault(CommandRoute<I, CommandMessage> newDefault); @CanIgnoreReturnValue CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via); Optional<CommandRoute<I, M>> get(Class<M> commandClass); }
CommandRouting extends MessageRouting<CommandMessage, CommandContext, I> { @CanIgnoreReturnValue public <M extends CommandMessage> CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via) throws IllegalStateException { @SuppressWarnings("unchecked") Route<CommandMessage, CommandContext, I> casted = (Route<CommandMessage, CommandContext, I>) via; addRoute(commandType, casted); return this; } private  CommandRouting(CommandRoute<I, CommandMessage> defaultRoute); static CommandRouting<I> newInstance(Class<I> idClass); @Override final CommandRoute<I, CommandMessage> defaultRoute(); @CanIgnoreReturnValue CommandRouting<I> replaceDefault(CommandRoute<I, CommandMessage> newDefault); @CanIgnoreReturnValue CommandRouting<I> route(Class<M> commandType, CommandRoute<I, M> via); Optional<CommandRoute<I, M>> get(Class<M> commandClass);  }