@Test public void testParseUrlGenerationParameters() { UrlGeneratorHandler handler = new UrlGeneratorHandler(); handler.parseAndVerifyArguments(Collections.singletonList(VCF_NAME), new ApplicationOptions()); ApplicationOptions options = new ApplicationOptions(); options.setLocation("chr1:1-2124"); handler.parseAndVerifyArguments(Collections.singletonList(VCF_NAME), options); options.setLocation("chr1"); handler.parseAndVerifyArguments(Collections.singletonList(VCF_NAME), options); }
@Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (CollectionUtils.isEmpty(arguments)) { throw new IllegalArgumentException(MessageConstants .getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } dataset = arguments.get(0); ids = arguments.subList(1, arguments.size()); printJson = options.isPrintJson(); printTable = options.isPrintTable(); String location = options.getLocation(); if (StringUtils.isNoneBlank(location)) { String[] parts = location.split(":"); chrName = parts[0]; if (parts.length > 1 && parts[1].contains("-")) { String[] subParts = parts[1].split("-"); if (NumberUtils.isDigits(subParts[0])) { startIndex = Integer.parseInt(subParts[0]); } if (NumberUtils.isDigits(subParts[1])) { endIndex = Integer.parseInt(subParts[1]); } } } }
UrlGeneratorHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (CollectionUtils.isEmpty(arguments)) { throw new IllegalArgumentException(MessageConstants .getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } dataset = arguments.get(0); ids = arguments.subList(1, arguments.size()); printJson = options.isPrintJson(); printTable = options.isPrintTable(); String location = options.getLocation(); if (StringUtils.isNoneBlank(location)) { String[] parts = location.split(":"); chrName = parts[0]; if (parts.length > 1 && parts[1].contains("-")) { String[] subParts = parts[1].split("-"); if (NumberUtils.isDigits(subParts[0])) { startIndex = Integer.parseInt(subParts[0]); } if (NumberUtils.isDigits(subParts[1])) { endIndex = Integer.parseInt(subParts[1]); } } } } }
UrlGeneratorHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (CollectionUtils.isEmpty(arguments)) { throw new IllegalArgumentException(MessageConstants .getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } dataset = arguments.get(0); ids = arguments.subList(1, arguments.size()); printJson = options.isPrintJson(); printTable = options.isPrintTable(); String location = options.getLocation(); if (StringUtils.isNoneBlank(location)) { String[] parts = location.split(":"); chrName = parts[0]; if (parts.length > 1 && parts[1].contains("-")) { String[] subParts = parts[1].split("-"); if (NumberUtils.isDigits(subParts[0])) { startIndex = Integer.parseInt(subParts[0]); } if (NumberUtils.isDigits(subParts[1])) { endIndex = Integer.parseInt(subParts[1]); } } } }  }
UrlGeneratorHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (CollectionUtils.isEmpty(arguments)) { throw new IllegalArgumentException(MessageConstants .getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } dataset = arguments.get(0); ids = arguments.subList(1, arguments.size()); printJson = options.isPrintJson(); printTable = options.isPrintTable(); String location = options.getLocation(); if (StringUtils.isNoneBlank(location)) { String[] parts = location.split(":"); chrName = parts[0]; if (parts.length > 1 && parts[1].contains("-")) { String[] subParts = parts[1].split("-"); if (NumberUtils.isDigits(subParts[0])) { startIndex = Integer.parseInt(subParts[0]); } if (NumberUtils.isDigits(subParts[1])) { endIndex = Integer.parseInt(subParts[1]); } } } }  @Override void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options); @Override int runCommand(); }
UrlGeneratorHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (CollectionUtils.isEmpty(arguments)) { throw new IllegalArgumentException(MessageConstants .getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } dataset = arguments.get(0); ids = arguments.subList(1, arguments.size()); printJson = options.isPrintJson(); printTable = options.isPrintTable(); String location = options.getLocation(); if (StringUtils.isNoneBlank(location)) { String[] parts = location.split(":"); chrName = parts[0]; if (parts.length > 1 && parts[1].contains("-")) { String[] subParts = parts[1].split("-"); if (NumberUtils.isDigits(subParts[0])) { startIndex = Integer.parseInt(subParts[0]); } if (NumberUtils.isDigits(subParts[1])) { endIndex = Integer.parseInt(subParts[1]); } } } }  @Override void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options); @Override int runCommand();  }