@Test(expected = SuperCsvConstraintViolationException.class) public void testInvalidObjectInput() { 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("Neo"); assertEquals(p1, processor.execute(p1, ANONYMOUS_CSVCONTEXT)); assertEquals(p2, processor.execute(p2, ANONYMOUS_CSVCONTEXT)); assertEquals(p3, processor.execute(p3, ANONYMOUS_CSVCONTEXT)); processor.execute(p4, 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);  }