Type Parameters:
S - the type of this validator
T - 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 Type
    Method
    Description
    isBetween(T minimum, boolean minimumIsInclusive, T maximum, boolean maximumIsInclusive)
    Ensures that the value is within a range.
    isBetween(T minimumInclusive, T maximumExclusive)
    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

      S isLessThan(T maximumExclusive)
      Ensures that the value is less than an upper bound.
      Parameters:
      maximumExclusive - the exclusive upper bound
      Returns:
      this
      Throws:
      NullPointerException - if the value or maximumExclusive are null
      IllegalArgumentException - if the value is greater than or equal to maximumExclusive
    • isLessThan

      S isLessThan(T maximumExclusive, String name)
      Ensures that the value is less than an upper bound.
      Parameters:
      maximumExclusive - the exclusive upper bound
      name - the name of the upper bound
      Returns:
      this
      Throws:
      NullPointerException - if the value or any of the arguments are null
      IllegalArgumentException - if:
      • name is empty
      • name contains whitespace
      • name is already in use by the value being validated or the validator context
      • the value is greater than or equal to maximumExclusive
    • isLessThanOrEqualTo

      S isLessThanOrEqualTo(T maximumInclusive)
      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 or maximumInclusive are null
      IllegalArgumentException - if the value is greater than maximumInclusive
    • isLessThanOrEqualTo

      S isLessThanOrEqualTo(T maximumInclusive, String name)
      Ensures that the value is less than or equal to a maximum value.
      Parameters:
      maximumInclusive - the maximum value
      name - the name of the maximum value
      Returns:
      this
      Throws:
      NullPointerException - if the value or any of the arguments are null
      IllegalArgumentException - if:
      • name is empty
      • name contains whitespace
      • name is already in use by the value being validated or the validator context
      • the value is greater than maximumInclusive
    • isGreaterThanOrEqualTo

      S isGreaterThanOrEqualTo(T minimumInclusive)
      Ensures that the value is greater than or equal to a minimum value.
      Parameters:
      minimumInclusive - the minimum value
      Returns:
      this
      Throws:
      NullPointerException - if value or minimumInclusive are null
      IllegalArgumentException - if the value is less than minimumInclusive
    • isGreaterThanOrEqualTo

      S isGreaterThanOrEqualTo(T minimumInclusive, String name)
      Ensures that the value is greater than or equal a minimum value.
      Parameters:
      minimumInclusive - the minimum value
      name - the name of the minimum value
      Returns:
      this
      Throws:
      NullPointerException - if the value or any of the arguments are null
      IllegalArgumentException - if:
      • name is empty
      • name contains whitespace
      • name is already in use by the value being validated or the validator context
      • the value is less than minimumInclusive
    • isGreaterThan

      S isGreaterThan(T minimumExclusive)
      Ensures that the value is greater than a lower bound.
      Parameters:
      minimumExclusive - the exclusive lower bound
      Returns:
      this
      Throws:
      NullPointerException - if the value or minimumExclusive are null
      IllegalArgumentException - if the value is less than or equal to minimumExclusive
    • isGreaterThan

      S isGreaterThan(T minimumExclusive, String name)
      Ensures that the value is greater than a lower bound.
      Parameters:
      minimumExclusive - the exclusive lower bound
      name - the name of the lower bound
      Returns:
      this
      Throws:
      NullPointerException - if the value or any of the arguments are null
      IllegalArgumentException - if:
      • name is empty
      • name contains whitespace
      • name is already in use by the value being validated or the validator context
      • the value is less than or equal to minimumInclusive
    • isBetween

      S isBetween(T minimumInclusive, T maximumExclusive)
      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 null
      IllegalArgumentException - if:
      • name is empty
      • name contains whitespace
      • name is already in use by the value being validated or the validator context
      • the value is greater than or equal to maximumExclusive
    • isBetween

      S isBetween(T minimum, boolean minimumIsInclusive, T maximum, boolean maximumIsInclusive)
      Ensures that the value is within a range.
      Parameters:
      minimum - the lower bound of the range
      minimumIsInclusive - true if the lower bound of the range is inclusive
      maximum - the upper bound of the range
      maximumIsInclusive - true if the upper bound of the range is inclusive
      Returns:
      this
      Throws:
      NullPointerException - if the value or any of the arguments are null
      IllegalArgumentException - if:
      • minimum is greater than maximum
      • minimumIsInclusive is true and the value is less than minimum
      • minimumIsInclusive is false and the value is less than or equal to minimum
      • maximumIsInclusive is true and the value is greater than maximum
      • maximumIsInclusive is false and the value is greater than or equal to maximum