@Test public void testValidObjectInput() { PersonBean p1 = new PersonBean(); p1.setFirstName("Neo"); PersonBean p2 = new PersonBean(); p2.setFirstName("Trinity"); PersonBean p3 = new PersonBean(); p3.setFirstName("Morpheus"); PersonBean p4 = new PersonBean(); p4.setFirstName("Switch"); for( PersonBean input : Arrays.asList(p1, p2, p3, p4) ) { assertEquals(input, processor.execute(input, ANONYMOUS_CSVCONTEXT)); assertEquals(input, processorChain.execute(input, ANONYMOUS_CSVCONTEXT)); } }
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); int hash = value.hashCode(); if( !uniqueSet.add(hash) ) { throw new SuperCsvConstraintViolationException( String.format("duplicate value '%s' encountered with hashcode %d", value, hash), context, this); } return next.execute(value, context); }
UniqueHashCode extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); int hash = value.hashCode(); if( !uniqueSet.add(hash) ) { throw new SuperCsvConstraintViolationException( String.format("duplicate value '%s' encountered with hashcode %d", value, hash), context, this); } return next.execute(value, context); } }
UniqueHashCode extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); int hash = value.hashCode(); if( !uniqueSet.add(hash) ) { throw new SuperCsvConstraintViolationException( String.format("duplicate value '%s' encountered with hashcode %d", value, hash), context, this); } return next.execute(value, context); } UniqueHashCode();  UniqueHashCode(final CellProcessor next); }
UniqueHashCode extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); int hash = value.hashCode(); if( !uniqueSet.add(hash) ) { throw new SuperCsvConstraintViolationException( String.format("duplicate value '%s' encountered with hashcode %d", value, hash), context, this); } return next.execute(value, context); } UniqueHashCode();  UniqueHashCode(final CellProcessor next); Object execute(final Object value, final CsvContext context); }
UniqueHashCode extends CellProcessorAdaptor { public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); int hash = value.hashCode(); if( !uniqueSet.add(hash) ) { throw new SuperCsvConstraintViolationException( String.format("duplicate value '%s' encountered with hashcode %d", value, hash), context, this); } return next.execute(value, context); } UniqueHashCode();  UniqueHashCode(final CellProcessor next); Object execute(final Object value, final CsvContext context);  }