Interface NumberConstraint

All Known Implementing Classes:
BigDecimalConstraint, BigIntegerConstraint, DoubleConstraint, FloatConstraint, LongConstraint

public interface NumberConstraint
Base interface for number type validators which contains all numeric restrictions.
  • Method Details

    • isMax

      boolean isMax(long max)
      Parameters:
      max - max value
      Returns:
      true if value less than or equal to max
    • isMin

      boolean isMin(long min)
      Parameters:
      min - min value
      Returns:
      true if value greater than or equal to min
    • isDigits

      boolean isDigits(int integer, int fraction)
      Parameters:
      integer - value of integer part
      fraction - value of fraction part
      Returns:
      true if value within accepted range
    • isDecimalMax

      boolean isDecimalMax(BigDecimal max, boolean inclusive)
      Parameters:
      max - max value
      inclusive - inclusive option, true by default
      Returns:
      true if value less than or equal to max (depends on inclusive option)
    • isDecimalMin

      boolean isDecimalMin(BigDecimal min, boolean inclusive)
      Parameters:
      min - min value
      inclusive - inclusive option, true by default
      Returns:
      true if value less than or equal to min (depends on inclusive option)
    • isNegativeOrZero

      boolean isNegativeOrZero()
      Returns:
      true if value is less than or equal to 0
    • isNegative

      boolean isNegative()
      Returns:
      true if value is strictly less than 0
    • isPositiveOrZero

      boolean isPositiveOrZero()
      Returns:
      true if value is greater than or equal to 0
    • isPositive

      boolean isPositive()
      Returns:
      true if value is strictly greater than 0
    • isDoubleMax

      boolean isDoubleMax(Double max, boolean inclusive)
      Parameters:
      max - max value
      inclusive - inclusive option, true by default
      Returns:
      true if value less than or equal to max (depends on inclusive option)
    • isDoubleMin

      boolean isDoubleMin(Double min, boolean inclusive)
      Parameters:
      min - min value
      inclusive - inclusive option, true by default
      Returns:
      true if value less than or equal to min (depends on inclusive option)