@Test public void testParametersNull() throws ParametersException { verifyException(tested, ParametersException.class).validateParameters(null, null); }
public void validateParameters(String dataRanges, String patternRanges) throws ParametersException { if (StringUtils.isBlank(dataRanges) && StringUtils.isBlank(patternRanges)) { throw new ParametersException("Either dataRanges or patternRanges should not be empty!"); } for (String ranges : new String[]{dataRanges, patternRanges}) { if (StringUtils.isNotBlank(ranges) && !PARAM_REGEX.matcher(ranges).matches()) { throw new ParametersException("Bad format : " + ranges); } } }
RemoveLinesDataModifier implements DataFilterJob<String> { public void validateParameters(String dataRanges, String patternRanges) throws ParametersException { if (StringUtils.isBlank(dataRanges) && StringUtils.isBlank(patternRanges)) { throw new ParametersException("Either dataRanges or patternRanges should not be empty!"); } for (String ranges : new String[]{dataRanges, patternRanges}) { if (StringUtils.isNotBlank(ranges) && !PARAM_REGEX.matcher(ranges).matches()) { throw new ParametersException("Bad format : " + ranges); } } } }
RemoveLinesDataModifier implements DataFilterJob<String> { public void validateParameters(String dataRanges, String patternRanges) throws ParametersException { if (StringUtils.isBlank(dataRanges) && StringUtils.isBlank(patternRanges)) { throw new ParametersException("Either dataRanges or patternRanges should not be empty!"); } for (String ranges : new String[]{dataRanges, patternRanges}) { if (StringUtils.isNotBlank(ranges) && !PARAM_REGEX.matcher(ranges).matches()) { throw new ParametersException("Bad format : " + ranges); } } }  }
RemoveLinesDataModifier implements DataFilterJob<String> { public void validateParameters(String dataRanges, String patternRanges) throws ParametersException { if (StringUtils.isBlank(dataRanges) && StringUtils.isBlank(patternRanges)) { throw new ParametersException("Either dataRanges or patternRanges should not be empty!"); } for (String ranges : new String[]{dataRanges, patternRanges}) { if (StringUtils.isNotBlank(ranges) && !PARAM_REGEX.matcher(ranges).matches()) { throw new ParametersException("Bad format : " + ranges); } } }  @Override void setParameters(Map<String, String> params); @Override String modifyData(String data); @Override String modifyPattern(String data); @Override String getInfo(); void validateParameters(String dataRanges, String patternRanges); }
RemoveLinesDataModifier implements DataFilterJob<String> { public void validateParameters(String dataRanges, String patternRanges) throws ParametersException { if (StringUtils.isBlank(dataRanges) && StringUtils.isBlank(patternRanges)) { throw new ParametersException("Either dataRanges or patternRanges should not be empty!"); } for (String ranges : new String[]{dataRanges, patternRanges}) { if (StringUtils.isNotBlank(ranges) && !PARAM_REGEX.matcher(ranges).matches()) { throw new ParametersException("Bad format : " + ranges); } } }  @Override void setParameters(Map<String, String> params); @Override String modifyData(String data); @Override String modifyPattern(String data); @Override String getInfo(); void validateParameters(String dataRanges, String patternRanges); static final String NAME; }