@Test public void testNullInput() { for (CellProcessor p : processors) { try { p.execute(null, ANONYMOUS_CSVCONTEXT); fail("expecting SuperCsvCellProcessorException"); } catch (SuperCsvCellProcessorException e) { assertEquals( "this processor does not accept null input - " + "if the column is optional then chain an Optional() processor before this one", e.getMessage()); } } }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof String)) { throw new SuperCsvCellProcessorException(String.class, value, context, this); } final Duration result; try { result = Duration.parse((String) value); } catch (IllegalArgumentException e) { throw new SuperCsvCellProcessorException( "Failed to parse value as a Duration", context, this, e); } return next.execute(result, context); }
ParseDuration extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof String)) { throw new SuperCsvCellProcessorException(String.class, value, context, this); } final Duration result; try { result = Duration.parse((String) value); } catch (IllegalArgumentException e) { throw new SuperCsvCellProcessorException( "Failed to parse value as a Duration", context, this, e); } return next.execute(result, context); } }
ParseDuration extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof String)) { throw new SuperCsvCellProcessorException(String.class, value, context, this); } final Duration result; try { result = Duration.parse((String) value); } catch (IllegalArgumentException e) { throw new SuperCsvCellProcessorException( "Failed to parse value as a Duration", context, this, e); } return next.execute(result, context); } ParseDuration();  ParseDuration(final CellProcessor next); }
ParseDuration extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof String)) { throw new SuperCsvCellProcessorException(String.class, value, context, this); } final Duration result; try { result = Duration.parse((String) value); } catch (IllegalArgumentException e) { throw new SuperCsvCellProcessorException( "Failed to parse value as a Duration", context, this, e); } return next.execute(result, context); } ParseDuration();  ParseDuration(final CellProcessor next); Object execute(final Object value, final CsvContext context); }
ParseDuration extends CellProcessorAdaptor implements StringCellProcessor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if (!(value instanceof String)) { throw new SuperCsvCellProcessorException(String.class, value, context, this); } final Duration result; try { result = Duration.parse((String) value); } catch (IllegalArgumentException e) { throw new SuperCsvCellProcessorException( "Failed to parse value as a Duration", context, this, e); } return next.execute(result, context); } ParseDuration();  ParseDuration(final CellProcessor next); Object execute(final Object value, final CsvContext context);  }