| Modifier and Type | Method and Description |
|---|---|
static <T> ViolationProvider |
ValidationRule.after(String field,
Comparable<T> value,
T other)
Checks if the compared value is strictly after the other.
|
static <T> ViolationProvider |
ValidationRule.afterOrEqualsTo(String field,
Comparable<T> value,
T other)
Checks if the compared value is after or equals to the other.
|
static <T> ViolationProvider |
ValidationRule.before(String field,
Comparable<T> value,
T other)
Checks if the compared value is strictly before the other.
|
static <T> ViolationProvider |
ValidationRule.beforeOrEqualsTo(String field,
Comparable<T> value,
T other)
Checks if the compared value is before or equals to the other.
|
static ViolationProvider |
ValidationRule.blank(String field,
CharSequence value)
Checks if the value is blank.
|
static <T> ViolationProvider |
ValidationRule.compareComparable(Comparable<T> value,
T other,
BiPredicate<Comparable<T>,T> compareFunc,
Supplier<Violation> violationFunc) |
static ViolationProvider |
ValidationRule.compareStrings(String value,
String other,
BiPredicate<String,String> compareFunc,
Supplier<Violation> violationFunc)
Compares the two string against a provided rule.
|
static ViolationProvider |
ValidationRule.empty(String field,
CharSequence value)
Checks if the value is empty.
|
static <T> ViolationProvider |
ValidationRule.equalsTo(String field,
Comparable<T> value,
T other)
Checks if the compared value equals the other.
|
static ViolationProvider |
ValidationRule.equalsTo(String field,
String value,
String other)
Checks if the compared value equals the other.
|
static ViolationProvider |
ValidationRule.inRange(String field,
Integer value,
int min,
int max)
Checks if the value is between or equals to one of the two limits.
|
static ViolationProvider |
ValidationRule.isFalse(BooleanSupplier condition,
Violation violation)
Checks if the condition is evaluated to false.
|
static ViolationProvider |
ValidationRule.isNull(String field,
Object value)
Checks if the value is null.
|
static ViolationProvider |
ValidationRule.isTrue(BooleanSupplier condition,
Violation violation)
Checks if the condition is evaluated to true.
|
static ViolationProvider |
ValidationRule.lengthBetween(String field,
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 field,
String value,
String regex)
Checks if the value matches the provided regex.
|
static ViolationProvider |
ValidationRule.max(String field,
Integer value,
int max)
Checks if the value is smaller than or equals to the provided superior limit.
|
static ViolationProvider |
ValidationRule.min(String field,
Integer value,
int min)
Checks if the value is grater than or equals to the provided inferior limit.
|
static ViolationProvider |
ValidationRule.negative(String field,
BigDecimal value) |
static ViolationProvider |
ValidationRule.negative(String field,
BigInteger value) |
static ViolationProvider |
ValidationRule.negative(String field,
Double value) |
static ViolationProvider |
ValidationRule.negative(String field,
Float value) |
static ViolationProvider |
ValidationRule.negative(String field,
Integer value) |
static ViolationProvider |
ValidationRule.negative(String field,
Long value) |
static ViolationProvider |
ValidationRule.negativeOrZero(String field,
BigDecimal value) |
static ViolationProvider |
ValidationRule.negativeOrZero(String field,
BigInteger value) |
static ViolationProvider |
ValidationRule.negativeOrZero(String field,
Double value) |
static ViolationProvider |
ValidationRule.negativeOrZero(String field,
Float value) |
static ViolationProvider |
ValidationRule.negativeOrZero(String field,
Integer value) |
static ViolationProvider |
ValidationRule.negativeOrZero(String field,
Long value) |
static ViolationProvider |
ValidationRule.notBlank(String field,
CharSequence value)
Checks if the value is not blank.
|
static ViolationProvider |
ValidationRule.notEmpty(String field,
CharSequence value)
Checks if the value is not empty.
|
static ViolationProvider |
ValidationRule.notEqualsTo(String field,
String value,
String other)
Checks if the compared value is not equal to the other.
|
static ViolationProvider |
ValidationRule.notNull(String field,
Object value)
Checks if the value is not null.
|
static ViolationProvider |
ValidationRule.positive(String field,
BigDecimal value) |
static ViolationProvider |
ValidationRule.positive(String field,
BigInteger value) |
static ViolationProvider |
ValidationRule.positive(String field,
Double value) |
static ViolationProvider |
ValidationRule.positive(String field,
Float value) |
static ViolationProvider |
ValidationRule.positive(String field,
Integer value) |
static ViolationProvider |
ValidationRule.positive(String field,
Long value) |
static ViolationProvider |
ValidationRule.positiveOrZero(String field,
BigDecimal value) |
static ViolationProvider |
ValidationRule.positiveOrZero(String field,
BigInteger value) |
static ViolationProvider |
ValidationRule.positiveOrZero(String field,
Double value) |
static ViolationProvider |
ValidationRule.positiveOrZero(String field,
Float value) |
static ViolationProvider |
ValidationRule.positiveOrZero(String field,
Integer value) |
static ViolationProvider |
ValidationRule.positiveOrZero(String field,
Long value) |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<ViolationProvider> |
ViolationProviderUtils.from(List<T> list,
BiFunction<Integer,T,ViolationProvider> mapper)
Creates
ViolationProviders from collection using a mapping function. |
| 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. |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<ViolationProvider> |
ViolationProviderUtils.from(List<T> list,
BiFunction<Integer,T,ViolationProvider> mapper)
Creates
ViolationProviders from collection using a mapping function. |
static List<Violation> |
ValidationEngine.validateAll(Collection<ViolationProvider> rules)
Validates all rules and return violations at the end.
|
static void |
ValidationEngine.validateAllAndStopIfViolations(Collection<ViolationProvider> rules)
Validates all rules and throw
ValidationException if there are any violations. |
static List<Violation> |
ValidationEngine.validateFindFirst(Collection<ViolationProvider> rules)
Validates all rules and stops when first violation is encountered.
|
static void |
ValidationEngine.validateFindFirstAndStopIfViolation(Collection<ViolationProvider> rules)
Validates rules and stops when first violation is encountered and then immediately throw
ValidationException. |
Copyright © 2020. All rights reserved.