/** * {@inheritDoc} * * @throws SuperCsvConstraintViolationException * if value isn't equal to the constant value (or previously encountered value if a constant wasn't * supplied) */ public Object execute(final Object value, final CsvContext context) { if( UNKNOWN.equals(constantValue) ) { constantValue = value; // no constant supplied, so remember the first value encountered } else { if( !equals(constantValue, value) ) { if( constantSupplied ) { throw new SuperCsvConstraintViolationException(String.format("'%s' is not equal to the supplied constant '%s'", value, constantValue), context, this); } else { throw new SuperCsvConstraintViolationException(String.format("'%s' is not equal to the previous value(s) of '%s'", value, constantValue), context, this); } } } return next.execute(value, context); }