/** * Gets the custom command-line for the arguments. * @param commandLine The input to the command-line. * @return custom command-line which is active (may only be one at a time) */ public CustomCommandLine<?> getActiveCustomCommandLine(CommandLine commandLine) { for (CustomCommandLine<?> cli : customCommandLines) { if (cli.isActive(commandLine)) { return cli; } } throw new IllegalStateException("No command-line ran."); }
@SuppressWarnings("unchecked") private static <T> CustomCommandLine<T> findActiveCommandLine(List<CustomCommandLine<?>> availableCommandLines, CommandLine commandLine) { for (CustomCommandLine<?> cli : availableCommandLines) { if (cli.isActive(commandLine)) { return (CustomCommandLine<T>) cli; } } throw new SqlExecutionException("Could not find a matching deployment."); }
/** * Gets the custom command-line for the arguments. * @param commandLine The input to the command-line. * @return custom command-line which is active (may only be one at a time) */ public CustomCommandLine<?> getActiveCustomCommandLine(CommandLine commandLine) { for (CustomCommandLine<?> cli : customCommandLines) { if (cli.isActive(commandLine)) { return cli; } } throw new IllegalStateException("No command-line ran."); }
/** * Gets the custom command-line for the arguments. * @param commandLine The input to the command-line. * @return custom command-line which is active (may only be one at a time) */ public CustomCommandLine getActiveCustomCommandLine(CommandLine commandLine) { for (CustomCommandLine cli : customCommandLine) { if (cli.isActive(commandLine, config)) { return cli; } } throw new IllegalStateException("No command-line ran."); }
/** * Gets the custom command-line for the arguments. * @param commandLine The input to the command-line. * @return custom command-line which is active (may only be one at a time) */ public CustomCommandLine<?> getActiveCustomCommandLine(CommandLine commandLine) { for (CustomCommandLine<?> cli : customCommandLines) { if (cli.isActive(commandLine)) { return cli; } } throw new IllegalStateException("No command-line ran."); }