@Test public void isValid() throws Exception { LowercaseValidator validator = new LowercaseValidator(); assertTrue(validator.isValid(null, null)); assertTrue(validator.isValid("lowercase@example.com", null)); assertFalse(validator.isValid("capitalized@Example.com", null)); }
public boolean isValid(String object, ConstraintValidatorContext constraintContext) { if (object == null) { return true; } return object.equals(object.toLowerCase()); }
LowercaseValidator implements ConstraintValidator<Lowercase, String> { public boolean isValid(String object, ConstraintValidatorContext constraintContext) { if (object == null) { return true; } return object.equals(object.toLowerCase()); } }
LowercaseValidator implements ConstraintValidator<Lowercase, String> { public boolean isValid(String object, ConstraintValidatorContext constraintContext) { if (object == null) { return true; } return object.equals(object.toLowerCase()); }  }
LowercaseValidator implements ConstraintValidator<Lowercase, String> { public boolean isValid(String object, ConstraintValidatorContext constraintContext) { if (object == null) { return true; } return object.equals(object.toLowerCase()); }  @Override void initialize(Lowercase lowercase); boolean isValid(String object, ConstraintValidatorContext constraintContext); }
LowercaseValidator implements ConstraintValidator<Lowercase, String> { public boolean isValid(String object, ConstraintValidatorContext constraintContext) { if (object == null) { return true; } return object.equals(object.toLowerCase()); }  @Override void initialize(Lowercase lowercase); boolean isValid(String object, ConstraintValidatorContext constraintContext);  }