@Test public void rejectsWhitespace() { assertThat(validator.isValid("ab cd", null)).isFalse(); }
@Override public boolean isValid(String value, ConstraintValidatorContext ctx) { try { if (value != null) { Base64.getDecoder().decode(value); } } catch (IllegalArgumentException ignored) { return false; } return true; }
ValidBase64Validator implements ConstraintValidator<ValidBase64, String> { @Override public boolean isValid(String value, ConstraintValidatorContext ctx) { try { if (value != null) { Base64.getDecoder().decode(value); } } catch (IllegalArgumentException ignored) { return false; } return true; } }
ValidBase64Validator implements ConstraintValidator<ValidBase64, String> { @Override public boolean isValid(String value, ConstraintValidatorContext ctx) { try { if (value != null) { Base64.getDecoder().decode(value); } } catch (IllegalArgumentException ignored) { return false; } return true; }  }
ValidBase64Validator implements ConstraintValidator<ValidBase64, String> { @Override public boolean isValid(String value, ConstraintValidatorContext ctx) { try { if (value != null) { Base64.getDecoder().decode(value); } } catch (IllegalArgumentException ignored) { return false; } return true; }  @Override void initialize(ValidBase64 constraintAnnotation); @Override boolean isValid(String value, ConstraintValidatorContext ctx); }
ValidBase64Validator implements ConstraintValidator<ValidBase64, String> { @Override public boolean isValid(String value, ConstraintValidatorContext ctx) { try { if (value != null) { Base64.getDecoder().decode(value); } } catch (IllegalArgumentException ignored) { return false; } return true; }  @Override void initialize(ValidBase64 constraintAnnotation); @Override boolean isValid(String value, ConstraintValidatorContext ctx);  }