public class ValidationUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <V extends Comparable<V>> |
checkGreaterThanMax(V value,
V maxValue)
Checks if the value being set to the component is greater than the max
value defined
|
static <V> ValidationResult |
checkRequired(boolean required,
V value,
V emptyValue)
Checks the required validation constraint
|
static <V extends Comparable<V>> |
checkSmallerThanMin(V value,
V minValue)
Checks if the value being set to the component is smaller than the max
value defined
|
public static <V> ValidationResult checkRequired(boolean required, V value, V emptyValue)
V
- the type of the component valuerequired
- the required state of the componentvalue
- the current value set on the componentemptyValue
- the empty value for the componentValidation.ok()
if the validation passes,
Validation.error()
otherwisepublic static <V extends Comparable<V>> ValidationResult checkGreaterThanMax(V value, V maxValue)
V
- the type of the component valuevalue
- the current value set on the componentmaxValue
- the max value set on the componentValidation.ok()
if the validation passes,
Validation.error()
otherwisepublic static <V extends Comparable<V>> ValidationResult checkSmallerThanMin(V value, V minValue)
V
- the type of the component valuevalue
- the current value set on the componentminValue
- the min value set on the componentValidation.ok()
if the validation passes,
Validation.error()
otherwiseCopyright © 2025. All rights reserved.