@Test(expected = UnsupportedException.class) public void testUnsupported() throws Exception { new EqualsConstraint(new Object(), VALID, PROPERTY_NAME).validate(); }
@Override @NonNull public Set<Violation> validate() { final Set<Violation> violations = new HashSet<>(); final String value = getStringFromObject(object, propertyName); if (!expectedValue.equalsIgnoreCase(value)) { violations.add(new Violation(propertyName, value, String.format(message, value), ERROR_CODE_IS_NOT_EQUALS)); } return violations; }
EqualsConstraint extends Constraint<Object> { @Override @NonNull public Set<Violation> validate() { final Set<Violation> violations = new HashSet<>(); final String value = getStringFromObject(object, propertyName); if (!expectedValue.equalsIgnoreCase(value)) { violations.add(new Violation(propertyName, value, String.format(message, value), ERROR_CODE_IS_NOT_EQUALS)); } return violations; } }
EqualsConstraint extends Constraint<Object> { @Override @NonNull public Set<Violation> validate() { final Set<Violation> violations = new HashSet<>(); final String value = getStringFromObject(object, propertyName); if (!expectedValue.equalsIgnoreCase(value)) { violations.add(new Violation(propertyName, value, String.format(message, value), ERROR_CODE_IS_NOT_EQUALS)); } return violations; } EqualsConstraint(@NonNull Object object, @NonNull String expectedValue, @NonNull String propertyName); }
EqualsConstraint extends Constraint<Object> { @Override @NonNull public Set<Violation> validate() { final Set<Violation> violations = new HashSet<>(); final String value = getStringFromObject(object, propertyName); if (!expectedValue.equalsIgnoreCase(value)) { violations.add(new Violation(propertyName, value, String.format(message, value), ERROR_CODE_IS_NOT_EQUALS)); } return violations; } EqualsConstraint(@NonNull Object object, @NonNull String expectedValue, @NonNull String propertyName); @Override @NonNull Set<Violation> validate(); void setMessage(String message); }
EqualsConstraint extends Constraint<Object> { @Override @NonNull public Set<Violation> validate() { final Set<Violation> violations = new HashSet<>(); final String value = getStringFromObject(object, propertyName); if (!expectedValue.equalsIgnoreCase(value)) { violations.add(new Violation(propertyName, value, String.format(message, value), ERROR_CODE_IS_NOT_EQUALS)); } return violations; } EqualsConstraint(@NonNull Object object, @NonNull String expectedValue, @NonNull String propertyName); @Override @NonNull Set<Violation> validate(); void setMessage(String message); static final String ERROR_CODE_IS_NOT_EQUALS; }