@Test public void testInputSameAsMax() { String input = "abc"; assertEquals(input, processor.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processor2.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain.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 String result; if( stringValue.length() <= maxSize ) { result = stringValue; } else { result = stringValue.substring(0, maxSize) + suffix; } return next.execute(result, context); }
Truncate extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor,
	DoubleCellProcessor, LongCellProcessor, StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final String result; if( stringValue.length() <= maxSize ) { result = stringValue; } else { result = stringValue.substring(0, maxSize) + suffix; } return next.execute(result, context); } }
Truncate extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor,
	DoubleCellProcessor, LongCellProcessor, StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final String result; if( stringValue.length() <= maxSize ) { result = stringValue; } else { result = stringValue.substring(0, maxSize) + suffix; } return next.execute(result, context); } Truncate(final int maxSize);  Truncate(final int maxSize, final String suffix);  Truncate(final int maxSize, final String suffix, final StringCellProcessor next);  Truncate(final int maxSize, final StringCellProcessor next); }
Truncate extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor,
	DoubleCellProcessor, LongCellProcessor, StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final String result; if( stringValue.length() <= maxSize ) { result = stringValue; } else { result = stringValue.substring(0, maxSize) + suffix; } return next.execute(result, context); } Truncate(final int maxSize);  Truncate(final int maxSize, final String suffix);  Truncate(final int maxSize, final String suffix, final StringCellProcessor next);  Truncate(final int maxSize, final StringCellProcessor next); Object execute(final Object value, final CsvContext context); }
Truncate extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor,
	DoubleCellProcessor, LongCellProcessor, StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String stringValue = value.toString(); final String result; if( stringValue.length() <= maxSize ) { result = stringValue; } else { result = stringValue.substring(0, maxSize) + suffix; } return next.execute(result, context); } Truncate(final int maxSize);  Truncate(final int maxSize, final String suffix);  Truncate(final int maxSize, final String suffix, final StringCellProcessor next);  Truncate(final int maxSize, final StringCellProcessor next); Object execute(final Object value, final CsvContext context);  }