Package org.moeaframework.util.validate
Class DoubleValidator
java.lang.Object
org.moeaframework.util.validate.Validator<T>
org.moeaframework.util.validate.NumberValidator<Double>
org.moeaframework.util.validate.DoubleValidator
Validator for
double
primitives.-
Constructor Summary
ConstructorDescriptionDoubleValidator
(String propertyName, double propertyValue) Constructs a new validator fordouble
primitives. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
isBetween
(double lower, double upper) Asserts the value is between the given lower and upper bounds, inclusive.final void
isFinite()
Asserts the value is a finite number (i.e., not infinite or 0d/0d).final void
isGreaterThan
(double thresholdValue) Asserts the value is greater than some threshold.final void
isGreaterThan
(String thresholdName, double thresholdValue) Asserts the value is greater than some threshold.final void
isGreaterThanOrEqualTo
(double thresholdValue) Asserts the value is greater than or equal to some threshold.final void
isGreaterThanOrEqualTo
(String thresholdName, double thresholdValue) Asserts the value is greater than or equal to some threshold.final void
isLessThan
(double thresholdValue) Asserts the value is less than some threshold.final void
isLessThan
(String thresholdName, double thresholdValue) Asserts the value is less than some threshold.final void
isLessThanOrEqualTo
(double thresholdValue) Asserts the value is less than or equal to some threshold.final void
isLessThanOrEqualTo
(String thresholdName, double thresholdValue) Asserts the value is less than or equal to some threshold.final void
Asserts the value represents a probability, meaning0.0 <= value <= 1.0
.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.Methods inherited from class org.moeaframework.util.validate.NumberValidator
failsOnCondition, failsOnCondition, isBetween, isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, isNotEqualTo
Methods inherited from class org.moeaframework.util.validate.Validator
fails, failUnsupportedOption, failUnsupportedOption, getPropertyName, getPropertyValue
-
Constructor Details
-
DoubleValidator
Constructs a new validator fordouble
primitives.- Parameters:
propertyName
- the property namepropertyValue
- 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
Asserts the value is greater than some threshold.- Parameters:
thresholdName
- the threshold namethresholdValue
- 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
Asserts the value is greater than or equal to some threshold.- Parameters:
thresholdName
- the threshold namethresholdValue
- the threshold value
-
isLessThan
public final void isLessThan(double thresholdValue) Asserts the value is less than some threshold.- Parameters:
thresholdValue
- the threshold value
-
isLessThan
Asserts the value is less than some threshold.- Parameters:
thresholdName
- the threshold namethresholdValue
- 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
Asserts the value is less than or equal to some threshold.- Parameters:
thresholdName
- the threshold namethresholdValue
- 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 boundupper
- 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 boundupper
- the upper bound
-
isProbability
public final void isProbability()Asserts the value represents a probability, meaning0.0 <= value <= 1.0
. -
isFinite
public final void isFinite()Asserts the value is a finite number (i.e., not infinite or 0d/0d).
-