| Modifier and Type | Method and Description |
|---|---|
static <T> ViolationProvider |
ValidationRule.after(String fieldPath,
Comparable<T> value,
T other)
Checks if the compared value is strictly after the other.
|
static <T> ViolationProvider |
ValidationRule.afterOrEqualsTo(String fieldPath,
Comparable<T> value,
T other)
Checks if the compared value is after or equals to the other.
|
static <T> ViolationProvider |
ValidationRule.before(String fieldPath,
Comparable<T> value,
T other)
Checks if the compared value is strictly before the other.
|
static <T> ViolationProvider |
ValidationRule.beforeOrEqualsTo(String fieldPath,
Comparable<T> value,
T other)
Checks if the compared value is before or equals to the other.
|
static ViolationProvider |
ValidationRule.blank(String fieldPath,
CharSequence value)
Checks if the value is blank.
|
static <T> ViolationProvider |
ValidationRule.compareComparables(String fieldPath,
Comparable<T> value,
T other,
BiFunction<Comparable<T>,T,Boolean> compareFunc,
Supplier<Violation> violationFunc) |
static ViolationProvider |
ValidationRule.compareStrings(String fieldPath,
String value,
String other,
BiFunction<String,String,Boolean> compareFunc,
Supplier<Violation> violationFunc)
Compares the two string against a provided rule.
|
static ViolationProvider |
ValidationRule.empty(String fieldPath,
CharSequence value)
Checks if the value is empty.
|
static <T> ViolationProvider |
ValidationRule.equalsTo(String fieldPath,
Comparable<T> value,
T other)
Checks if the compared value equals the other.
|
static ViolationProvider |
ValidationRule.equalsTo(String fieldPath,
String value,
String other)
Checks if the compared value equals the other.
|
static ViolationProvider |
ValidationRule.inRange(String fieldPath,
Integer value,
int min,
int max)
Checks if the value is between or equals to one of the two limits.
|
static ViolationProvider |
ValidationRule.isNull(String fieldPath,
Object value)
Checks if the value is null.
|
static ViolationProvider |
ValidationRule.lengthBetween(String fieldPath,
CharSequence value,
int min,
int max)
Checks if the value has the length between or equals to one of two limits.
|
static ViolationProvider |
ValidationRule.matchRegex(String fieldPath,
String value,
String regex)
Checks if the value matches the provided regex.
|
static ViolationProvider |
ValidationRule.max(String fieldPath,
Integer value,
int max)
Checks if the value is smaller than or equals to the provided superior limit.
|
static ViolationProvider |
ValidationRule.min(String fieldPath,
Integer value,
int min)
Checks if the value is grater than or equals to the provided inferior limit.
|
static ViolationProvider |
ValidationRule.notBlank(String fieldPath,
CharSequence value)
Checks if the value is not blank.
|
static ViolationProvider |
ValidationRule.notEmpty(String fieldPath,
CharSequence value)
Checks if the value is not empty.
|
static ViolationProvider |
ValidationRule.notEqualsTo(String fieldPath,
String value,
String other)
Checks if the compared value is not equal to the other.
|
static ViolationProvider |
ValidationRule.notNull(String fieldPath,
Object value)
Checks if the value is not null.
|
| Modifier and Type | Method and Description |
|---|---|
static List<Violation> |
ValidationEngine.validateAll(ViolationProvider... rules)
Validates all rules and return violations at the end.
|
static void |
ValidationEngine.validateAllAndStopIfViolations(ViolationProvider... rules)
Validates all rules and throw
ValidationException if there are any violations. |
static List<Violation> |
ValidationEngine.validateFindFirst(ViolationProvider... rules)
Validates all rules and stops when first violation is encountered.
|
static void |
ValidationEngine.validateFindFirstAndStopIfViolation(ViolationProvider... rules)
Validates rules and stops when first violation is encountered and then immediately throw
ValidationException. |
Copyright © 2020. All rights reserved.