@Test public void testValidInput() { String input = "OK"; assertEquals(input, processor.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain2.execute(input, ANONYMOUS_CSVCONTEXT)); input = "yep"; assertEquals(input, processor.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain2.execute(input, ANONYMOUS_CSVCONTEXT)); }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final int length = stringValue.length(); if( !requiredLengths.contains(length) ) { throw new SuperCsvConstraintViolationException(String.format("the length (%d) of value '%s' not any of the required lengths", length, stringValue), context, this); } return next.execute(value, context); }
Strlen extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final int length = stringValue.length(); if( !requiredLengths.contains(length) ) { throw new SuperCsvConstraintViolationException(String.format("the length (%d) of value '%s' not any of the required lengths", length, stringValue), context, this); } return next.execute(value, context); } }
Strlen extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final int length = stringValue.length(); if( !requiredLengths.contains(length) ) { throw new SuperCsvConstraintViolationException(String.format("the length (%d) of value '%s' not any of the required lengths", length, stringValue), context, this); } return next.execute(value, context); } Strlen(final int... requiredLengths);  Strlen(final int requiredLength, final CellProcessor next);  Strlen(final int[] requiredLengths, final CellProcessor next); }
Strlen extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final int length = stringValue.length(); if( !requiredLengths.contains(length) ) { throw new SuperCsvConstraintViolationException(String.format("the length (%d) of value '%s' not any of the required lengths", length, stringValue), context, this); } return next.execute(value, context); } Strlen(final int... requiredLengths);  Strlen(final int requiredLength, final CellProcessor next);  Strlen(final int[] requiredLengths, final CellProcessor next); Object execute(final Object value, final CsvContext context); }
Strlen extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final int length = stringValue.length(); if( !requiredLengths.contains(length) ) { throw new SuperCsvConstraintViolationException(String.format("the length (%d) of value '%s' not any of the required lengths", length, stringValue), context, this); } return next.execute(value, context); } Strlen(final int... requiredLengths);  Strlen(final int requiredLength, final CellProcessor next);  Strlen(final int[] requiredLengths, final CellProcessor next); Object execute(final Object value, final CsvContext context);  }