public class CommonValidationsWithErrorCode extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T,C extends Comparable<T>> |
isBetween(java.util.function.Supplier<T> min,
java.util.function.Supplier<T> max,
String errorCode)
returns a validation which validates that the validated value is between two another values.
|
static <T,C extends Comparable<T>> |
isBetween(T min,
T max,
String errorCode)
returns a validation which validates that the validated value is between two another values.
|
static <T> Validation<T> |
isEqualTo(java.util.function.Supplier<T> compareTo,
String errorCode)
returns a validation which validates that the validated value is equal to another one.
|
static <T> Validation<T> |
isEqualTo(T compareTo,
String errorCode)
returns a validation which validates that the validated value is equal to another one.
|
static Validation<Boolean> |
isFalse(String errorCode)
returns a validation which validats that the validated value is false.
|
static <T,C extends Comparable<T>> |
isGreaterThan(java.util.function.Supplier<T> compareTo,
String errorCode)
returns a validation which validates that the validated value is greater than another one.
|
static <T,C extends Comparable<T>> |
isGreaterThan(T compareTo,
String errorCode)
returns a validation which validates that the validated value is greater than another one.
|
static <T,C extends Comparable<T>> |
isLessThan(java.util.function.Supplier<T> compareTo,
String errorCode)
returns a validation which validates that the validated value is less than another one.
|
static <T,C extends Comparable<T>> |
isLessThan(T compareTo,
String errorCode)
returns a validation which validates that the validated value is less than another one.
|
static <T> Validation<T> |
isNotEqualTo(java.util.function.Supplier<T> compareTo,
String errorCode)
returns a validation which validates that the validated value is NOT equal to another one.
|
static <T> Validation<T> |
isNotEqualTo(T compareTo,
String errorCode)
returns a validation which validates that the validated value is NOT equal to another one.
|
static <T> Validation<T> |
isNull(String errorCode)
returns a validation which validates that a value is null.
|
static Validation<Boolean> |
isTrue(String errorCode)
returns a validation which validats that the validated value is true.
|
static <T> Validation<T> |
notNull(String errorCode)
returns a validation which validates that a value is not null.
|
public static <T> Validation<T> notNull(String errorCode)
T - type of the tested valueerrorCode - in the case the validation violates this code is reported in the resultpublic static <T> Validation<T> isNull(String errorCode)
T - type of the tested valueerrorCode - in the case the validation violates this code is reported in the resultpublic static <T> Validation<T> isEqualTo(T compareTo, String errorCode)
T - type of the tested valuecompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T> Validation<T> isEqualTo(java.util.function.Supplier<T> compareTo, String errorCode)
T - type of the tested valuecompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T> Validation<T> isNotEqualTo(T compareTo, String errorCode)
T - type of the tested valuecompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T> Validation<T> isNotEqualTo(java.util.function.Supplier<T> compareTo, String errorCode)
T - type of the tested valuecompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T,C extends Comparable<T>> Validation<C> isLessThan(T compareTo, String errorCode)
T - type of the tested valueC - the comparable to TcompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T,C extends Comparable<T>> Validation<C> isLessThan(java.util.function.Supplier<T> compareTo, String errorCode)
T - type of the tested valueC - the comparable to TcompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T,C extends Comparable<T>> Validation<C> isGreaterThan(T compareTo, String errorCode)
T - type of the tested valueC - the comparable to TcompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T,C extends Comparable<T>> Validation<C> isGreaterThan(java.util.function.Supplier<T> compareTo, String errorCode)
T - type of the tested valueC - the comparable to TcompareTo - the validated value is compared to this oneerrorCode - in the case the validation violates this code is reported in the resultpublic static <T,C extends Comparable<T>> Validation<C> isBetween(T min, T max, String errorCode)
T - type of the tested valueC - the comparable to Tmin - the minimum allowed valuemax - the maximum allowed valueerrorCode - in the case the validation violates this code is reported in the resultpublic static <T,C extends Comparable<T>> Validation<C> isBetween(java.util.function.Supplier<T> min, java.util.function.Supplier<T> max, String errorCode)
T - type of the tested valueC - the comparable to Tmin - the minimum allowed valuemax - the maximum allowed valueerrorCode - in the case the validation violates this code is reported in the resultpublic static Validation<Boolean> isTrue(String errorCode)
errorCode - in the case the validation violates this code is reported in the resultpublic static Validation<Boolean> isFalse(String errorCode)
errorCode - in the case the validation violates this code is reported in the resultCopyright © 2018. All rights reserved.