Package org.moeaframework.util.validate
Class IntegerValidator
java.lang.Object
org.moeaframework.util.validate.Validator<T>
org.moeaframework.util.validate.NumberValidator<Integer>
org.moeaframework.util.validate.IntegerValidator
Validator for
int primitives.-
Constructor Summary
ConstructorsConstructorDescriptionIntegerValidator(String propertyName, int propertyValue) Constructs a new validator forintprimitives. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidisBetween(int lower, int upper) Asserts the value is between the given lower and upper bounds, inclusive.final voidisDivisibleBy(int divisorValue) Asserts the value is divisible by some divisor.final voidisDivisibleBy(String divisorName, int divisorValue) Asserts the value is divisible by some divisor.final voidisEqualTo(int parameterValue) Asserts the value equals some other parameter.final voidAsserts the value equals some other parameter.final voidisGreaterThan(int thresholdValue) Asserts the value is greater than some threshold.final voidisGreaterThan(String thresholdName, int thresholdValue) Asserts the value is greater than some threshold.final voidisGreaterThanOrEqualTo(int thresholdValue) Asserts the value is greater than or equal to some threshold.final voidisGreaterThanOrEqualTo(String thresholdName, int thresholdValue) Asserts the value is greater than or equal to some threshold.final voidisLessThan(int thresholdValue) Asserts the value is less than some threshold.final voidisLessThan(String thresholdName, int thresholdValue) Asserts the value is less than some threshold.final voidisLessThanOrEqualTo(int thresholdValue) Asserts the value is less than or equal to some threshold.final voidisLessThanOrEqualTo(String thresholdName, int thresholdValue) Asserts the value is less than or equal to some threshold.final voidisNotEqualTo(int parameterValue) Asserts the value is not equal to some other parameter.final voidisNotEqualTo(String parameterName, int parameterValue) Asserts the value is not equal to some other parameter.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
-
IntegerValidator
Constructs a new validator forintprimitives.- Parameters:
propertyName- the property namepropertyValue- the property value
-
-
Method Details
-
isGreaterThan
public final void isGreaterThan(int 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(int 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(int 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(int 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
-
isEqualTo
public final void isEqualTo(int parameterValue) Asserts the value equals some other parameter.- Parameters:
parameterValue- the parameter value
-
isEqualTo
Asserts the value equals some other parameter.- Parameters:
parameterName- the parameter nameparameterValue- the parameter value
-
isNotEqualTo
public final void isNotEqualTo(int parameterValue) Asserts the value is not equal to some other parameter.- Parameters:
parameterValue- the parameter value
-
isNotEqualTo
Asserts the value is not equal to some other parameter.- Parameters:
parameterName- the parameter nameparameterValue- the parameter value
-
isDivisibleBy
public final void isDivisibleBy(int divisorValue) Asserts the value is divisible by some divisor.- Parameters:
divisorValue- the divisor value
-
isDivisibleBy
Asserts the value is divisible by some divisor.- Parameters:
divisorName- the divisor name, ornullif no name is associated with the valuedivisorValue- the divisor value
-
isBetween
public final void isBetween(int lower, int upper) Asserts the value is between the given lower and upper bounds, inclusive.- Parameters:
lower- the lower boundupper- the upper bound
-