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
ConstructorsConstructorDescriptionDoubleValidator(String propertyName, double propertyValue) Constructs a new validator fordoubleprimitives. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidisBetween(double lower, double upper) Asserts the value is between the given lower and upper bounds, inclusive.final voidisFinite()Asserts the value is a finite number (i.e., not infinite or 0d/0d).final voidisGreaterThan(double thresholdValue) Asserts the value is greater than some threshold.final voidisGreaterThan(String thresholdName, double thresholdValue) Asserts the value is greater than some threshold.final voidisGreaterThanOrEqualTo(double thresholdValue) Asserts the value is greater than or equal to some threshold.final voidisGreaterThanOrEqualTo(String thresholdName, double thresholdValue) Asserts the value is greater than or equal to some threshold.final voidisLessThan(double thresholdValue) Asserts the value is less than some threshold.final voidisLessThan(String thresholdName, double thresholdValue) Asserts the value is less than some threshold.final voidisLessThanOrEqualTo(double thresholdValue) Asserts the value is less than or equal to some threshold.final voidisLessThanOrEqualTo(String thresholdName, double thresholdValue) Asserts the value is less than or equal to some threshold.final voidAsserts the value represents a probability, meaning0.0 <= value <= 1.0.final voidisStrictlyBetween(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, isNotEqualToMethods inherited from class org.moeaframework.util.validate.Validator
fails, failUnsupportedOption, failUnsupportedOption, getPropertyName, getPropertyValue
-
Constructor Details
-
DoubleValidator
Constructs a new validator fordoubleprimitives.- 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).
-