@Test public void testValidInput() { String input = "to infinity and beyond!"; assertEquals(input, processor.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain2.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain3.execute(input, ANONYMOUS_CSVCONTEXT)); }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); for( final String required : requiredSubStrings ) { if( stringValue.contains(required) ) { return next.execute(value, context); } } throw new SuperCsvConstraintViolationException(String.format("'%s' does not contain any of the required substrings", value), context, this); }
RequireSubStr extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); for( final String required : requiredSubStrings ) { if( stringValue.contains(required) ) { return next.execute(value, context); } } throw new SuperCsvConstraintViolationException(String.format("'%s' does not contain any of the required substrings", value), context, this); } }
RequireSubStr extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); for( final String required : requiredSubStrings ) { if( stringValue.contains(required) ) { return next.execute(value, context); } } throw new SuperCsvConstraintViolationException(String.format("'%s' does not contain any of the required substrings", value), context, this); } RequireSubStr(final String... requiredSubStrings);  RequireSubStr(final List<String> requiredSubStrings, final CellProcessor next);  RequireSubStr(final String requiredSubString, final CellProcessor next);  RequireSubStr(final String[] requiredSubStrings, final CellProcessor next); }
RequireSubStr extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); for( final String required : requiredSubStrings ) { if( stringValue.contains(required) ) { return next.execute(value, context); } } throw new SuperCsvConstraintViolationException(String.format("'%s' does not contain any of the required substrings", value), context, this); } RequireSubStr(final String... requiredSubStrings);  RequireSubStr(final List<String> requiredSubStrings, final CellProcessor next);  RequireSubStr(final String requiredSubString, final CellProcessor next);  RequireSubStr(final String[] requiredSubStrings, final CellProcessor next); Object execute(final Object value, final CsvContext context); }
RequireSubStr extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); for( final String required : requiredSubStrings ) { if( stringValue.contains(required) ) { return next.execute(value, context); } } throw new SuperCsvConstraintViolationException(String.format("'%s' does not contain any of the required substrings", value), context, this); } RequireSubStr(final String... requiredSubStrings);  RequireSubStr(final List<String> requiredSubStrings, final CellProcessor next);  RequireSubStr(final String requiredSubString, final CellProcessor next);  RequireSubStr(final String[] requiredSubStrings, final CellProcessor next); Object execute(final Object value, final CsvContext context);  }