Class DoubleValidator


public final class DoubleValidator extends NumberValidator<Double>
Validator for double primitives.
  • Constructor Details

    • DoubleValidator

      public DoubleValidator(String propertyName, double propertyValue)
      Constructs a new validator for double primitives.
      Parameters:
      propertyName - the property name
      propertyValue - the property value
  • Method Details

    • isGreaterThan

      public final void isGreaterThan(double thresholdValue)
      Asserts the value is greater than some threshold.
      Parameters:
      thresholdValue - the threshold value
    • isGreaterThan

      public final void isGreaterThan(String thresholdName, double thresholdValue)
      Asserts the value is greater than some threshold.
      Parameters:
      thresholdName - the threshold name
      thresholdValue - the threshold value
    • isGreaterThanOrEqualTo

      public final void isGreaterThanOrEqualTo(double thresholdValue)
      Asserts the value is greater than or equal to some threshold.
      Parameters:
      thresholdValue - the threshold value
    • isGreaterThanOrEqualTo

      public final void isGreaterThanOrEqualTo(String thresholdName, double thresholdValue)
      Asserts the value is greater than or equal to some threshold.
      Parameters:
      thresholdName - the threshold name
      thresholdValue - the threshold value
    • isLessThan

      public final void isLessThan(double thresholdValue)
      Asserts the value is less than some threshold.
      Parameters:
      thresholdValue - the threshold value
    • isLessThan

      public final void isLessThan(String thresholdName, double thresholdValue)
      Asserts the value is less than some threshold.
      Parameters:
      thresholdName - the threshold name
      thresholdValue - the threshold value
    • isLessThanOrEqualTo

      public final void isLessThanOrEqualTo(double thresholdValue)
      Asserts the value is less than or equal to some threshold.
      Parameters:
      thresholdValue - the threshold value
    • isLessThanOrEqualTo

      public final void isLessThanOrEqualTo(String thresholdName, double thresholdValue)
      Asserts the value is less than or equal to some threshold.
      Parameters:
      thresholdName - the threshold name
      thresholdValue - the threshold value
    • isBetween

      public final void isBetween(double lower, double upper)
      Asserts the value is between the given lower and upper bounds, inclusive.
      Parameters:
      lower - the lower bound
      upper - the upper bound
    • isStrictlyBetween

      public final void isStrictlyBetween(double lower, double upper)
      Asserts the value is between the given lower and upper bounds, but not equal to the lower or upper bounds.
      Parameters:
      lower - the lower bound
      upper - the upper bound
    • isProbability

      public final void isProbability()
      Asserts the value represents a probability, meaning 0.0 <= value <= 1.0.
    • isFinite

      public final void isFinite()
      Asserts the value is a finite number (i.e., not infinite or 0d/0d).