Interface ComparableComponent<S,T extends Comparable<T>>
- Type Parameters:
S- the type of this validatorT- the type of the value that is being validated
- All Known Subinterfaces:
BigDecimalValidator,BigIntegerValidator,ByteValidator,CharacterValidator,ComparableValidator<T>,DoubleValidator,FloatValidator,IntegerValidator,LongValidator,PrimitiveByteValidator,PrimitiveCharacterValidator,PrimitiveDoubleValidator,PrimitiveFloatValidator,PrimitiveIntegerValidator,PrimitiveLongValidator,PrimitiveShortValidator,PrimitiveUnsignedIntegerValidator,ShortValidator,UnsignedIntegerValidator
public interface ComparableComponent<S,T extends Comparable<T>>
Methods that all
Comparable validators must contain.-
Method Summary
Modifier and TypeMethodDescriptionEnsures that the value is within a range.Ensures that the value is within a range.isGreaterThan(T minimumExclusive) Ensures that the value is greater than a lower bound.isGreaterThan(T minimumExclusive, String name) Ensures that the value is greater than a lower bound.isGreaterThanOrEqualTo(T minimumInclusive) Ensures that the value is greater than or equal to a minimum value.isGreaterThanOrEqualTo(T minimumInclusive, String name) Ensures that the value is greater than or equal a minimum value.isLessThan(T maximumExclusive) Ensures that the value is less than an upper bound.isLessThan(T maximumExclusive, String name) Ensures that the value is less than an upper bound.isLessThanOrEqualTo(T maximumInclusive) Ensures that the value is less than or equal to a maximum value.isLessThanOrEqualTo(T maximumInclusive, String name) Ensures that the value is less than or equal to a maximum value.
-
Method Details
-
isLessThan
Ensures that the value is less than an upper bound.- Parameters:
maximumExclusive- the exclusive upper bound- Returns:
- this
- Throws:
NullPointerException- if the value ormaximumExclusiveare nullIllegalArgumentException- if the value is greater than or equal tomaximumExclusive
-
isLessThan
Ensures that the value is less than an upper bound.- Parameters:
maximumExclusive- the exclusive upper boundname- the name of the upper bound- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is greater than or equal to
maximumExclusive
-
isLessThanOrEqualTo
Ensures that the value is less than or equal to a maximum value.- Parameters:
maximumInclusive- the inclusive upper value- Returns:
- this
- Throws:
NullPointerException- if the value ormaximumInclusiveare nullIllegalArgumentException- if the value is greater thanmaximumInclusive
-
isLessThanOrEqualTo
Ensures that the value is less than or equal to a maximum value.- Parameters:
maximumInclusive- the maximum valuename- the name of the maximum value- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is greater than
maximumInclusive
-
isGreaterThanOrEqualTo
Ensures that the value is greater than or equal to a minimum value.- Parameters:
minimumInclusive- the minimum value- Returns:
- this
- Throws:
NullPointerException- if value orminimumInclusiveare nullIllegalArgumentException- if the value is less thanminimumInclusive
-
isGreaterThanOrEqualTo
Ensures that the value is greater than or equal a minimum value.- Parameters:
minimumInclusive- the minimum valuename- the name of the minimum value- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is less than
minimumInclusive
-
isGreaterThan
Ensures that the value is greater than a lower bound.- Parameters:
minimumExclusive- the exclusive lower bound- Returns:
- this
- Throws:
NullPointerException- if the value orminimumExclusiveare nullIllegalArgumentException- if the value is less than or equal tominimumExclusive
-
isGreaterThan
Ensures that the value is greater than a lower bound.- Parameters:
minimumExclusive- the exclusive lower boundname- the name of the lower bound- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is less than or equal to
minimumInclusive
-
isBetween
Ensures that the value is within a range.- Parameters:
minimumInclusive- the lower bound of the range (inclusive)maximumExclusive- the upper bound of the range (exclusive)- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is greater than or equal to
maximumExclusive
-
isBetween
Ensures that the value is within a range.- Parameters:
minimum- the lower bound of the rangeminimumIsInclusive-trueif the lower bound of the range is inclusivemaximum- the upper bound of the rangemaximumIsInclusive-trueif the upper bound of the range is inclusive- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:minimumis greater thanmaximumminimumIsInclusiveistrueand the value is less thanminimumminimumIsInclusiveisfalseand the value is less than or equal tominimummaximumIsInclusiveistrueand the value is greater thanmaximummaximumIsInclusiveisfalseand the value is greater than or equal tomaximum
-