@Test public void exactlyTest() { StringLengthValidator s = StringLengthValidator.exactly(3, "test"); Assert.assertFalse(s.validate("gfyf").getResult()); Assert.assertTrue(s.validate(" ").getResult()); Assert.assertTrue(s.validate("aee").getResult()); Assert.assertFalse(s.validate("ee").getResult()); }
public static StringLengthValidator exactly(int value, String errorMessage) { return new StringLengthValidator(value, value, errorMessage); }
StringLengthValidator extends CustomValidator<String> { public static StringLengthValidator exactly(int value, String errorMessage) { return new StringLengthValidator(value, value, errorMessage); } }
StringLengthValidator extends CustomValidator<String> { public static StringLengthValidator exactly(int value, String errorMessage) { return new StringLengthValidator(value, value, errorMessage); } private  StringLengthValidator(int min, int max, String errorMessage); }
StringLengthValidator extends CustomValidator<String> { public static StringLengthValidator exactly(int value, String errorMessage) { return new StringLengthValidator(value, value, errorMessage); } private  StringLengthValidator(int min, int max, String errorMessage); static StringLengthValidator between(int min, int max, String errorMessage); static StringLengthValidator atLeast(int min, String errorMessage); static StringLengthValidator upTo(int max, String errorMessage); static StringLengthValidator exactly(int value, String errorMessage); }
StringLengthValidator extends CustomValidator<String> { public static StringLengthValidator exactly(int value, String errorMessage) { return new StringLengthValidator(value, value, errorMessage); } private  StringLengthValidator(int min, int max, String errorMessage); static StringLengthValidator between(int min, int max, String errorMessage); static StringLengthValidator atLeast(int min, String errorMessage); static StringLengthValidator upTo(int max, String errorMessage); static StringLengthValidator exactly(int value, String errorMessage);  }