Class NumberValidationRules
java.lang.Object
org.strassburger.tui4j.input.validationrules.NumberValidationRules
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Number & Comparable<T>>
ValidationRule<T>greaterThan(T value) Validates that the input is greater than the given value.static <T extends Number & Comparable<T>>
ValidationRule<T>greaterThan(T value, String errorMessage) Validates that the input is greater than the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>greaterThan(T value, StyledText errorMessage) Validates that the input is greater than the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>greaterThanOrEqualTo(T value) Validates that the input is greater than or equal to the given value.static <T extends Number & Comparable<T>>
ValidationRule<T>greaterThanOrEqualTo(T value, String errorMessage) Validates that the input is greater than or equal to the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>greaterThanOrEqualTo(T value, StyledText errorMessage) Validates that the input is greater than or equal to the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>lessThan(T value) Validates that the input is equal to the given value.static <T extends Number & Comparable<T>>
ValidationRule<T>Validates that the input is equal to the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>lessThan(T value, StyledText errorMessage) Validates that the input is equal to the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>lessThanOrEqualTo(T value) Validates that the input is less than or equal to the given value.static <T extends Number & Comparable<T>>
ValidationRule<T>lessThanOrEqualTo(T value, String errorMessage) Validates that the input is less than or equal to the given value with a custom error message.static <T extends Number & Comparable<T>>
ValidationRule<T>lessThanOrEqualTo(T value, StyledText errorMessage) Validates that the input is less than or equal to the given value with a custom error message.
-
Constructor Details
-
NumberValidationRules
public NumberValidationRules()
-
-
Method Details
-
lessThan
Validates that the input is equal to the given value.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.- Returns:
- A ValidationRule that validates that the input is equal to the given value.
-
lessThan
public static <T extends Number & Comparable<T>> ValidationRule<T> lessThan(T value, String errorMessage) Validates that the input is equal to the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is equal to the given value.
-
lessThan
public static <T extends Number & Comparable<T>> ValidationRule<T> lessThan(T value, StyledText errorMessage) Validates that the input is equal to the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is equal to the given value.
-
greaterThan
Validates that the input is greater than the given value.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.- Returns:
- A ValidationRule that validates that the input is greater than the given value.
-
greaterThan
public static <T extends Number & Comparable<T>> ValidationRule<T> greaterThan(T value, String errorMessage) Validates that the input is greater than the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is greater than the given value.
-
greaterThan
public static <T extends Number & Comparable<T>> ValidationRule<T> greaterThan(T value, StyledText errorMessage) Validates that the input is greater than the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is greater than the given value.
-
lessThanOrEqualTo
Validates that the input is less than or equal to the given value.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.- Returns:
- A ValidationRule that validates that the input is less than or equal to the given value.
-
lessThanOrEqualTo
public static <T extends Number & Comparable<T>> ValidationRule<T> lessThanOrEqualTo(T value, String errorMessage) Validates that the input is less than or equal to the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is less than or equal to the given value.
-
lessThanOrEqualTo
public static <T extends Number & Comparable<T>> ValidationRule<T> lessThanOrEqualTo(T value, StyledText errorMessage) Validates that the input is less than or equal to the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is less than or equal to the given value.
-
greaterThanOrEqualTo
Validates that the input is greater than or equal to the given value.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.- Returns:
- A ValidationRule that validates that the input is greater than or equal to the given value.
-
greaterThanOrEqualTo
public static <T extends Number & Comparable<T>> ValidationRule<T> greaterThanOrEqualTo(T value, String errorMessage) Validates that the input is greater than or equal to the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is greater than or equal to the given value.
-
greaterThanOrEqualTo
public static <T extends Number & Comparable<T>> ValidationRule<T> greaterThanOrEqualTo(T value, StyledText errorMessage) Validates that the input is greater than or equal to the given value with a custom error message.- Type Parameters:
T- The type of the input.- Parameters:
value- The value to compare the input to.errorMessage- The custom error message.- Returns:
- A ValidationRule that validates that the input is greater than or equal to the given value.
-