Class GNumberRangeValidator
java.lang.Object
ch.tocco.nice2.validate.api.generic.GNumberRangeValidator
- All Implemented Interfaces:
Cloneable
A generic validator for verifying that a Number is within an allowed range.
Bounds may be open or closed, as well as inclusive or exclusive.
-
Constructor Summary
ConstructorDescriptionGNumberRangeValidator
(@Nullable Double lowerBound, boolean includeLowerBound, @Nullable Double upperBound, boolean includeUpperBound) -
Method Summary
Modifier and TypeMethodDescriptionclone()
@Nullable Double
@Nullable Double
boolean
boolean
void
setIncludeLowerBound
(boolean includeLowerBound) void
setIncludeUpperBound
(boolean includeUpperBound) void
setLowerBound
(@Nullable Double lowerBound) void
setUpperBound
(@Nullable Double upperBound) boolean
validate
(double value) boolean
validateMax
(double value) boolean
validateMin
(double value)
-
Constructor Details
-
GNumberRangeValidator
-
-
Method Details
-
getLowerBound
-
getUpperBound
-
setLowerBound
-
setUpperBound
-
isIncludeLowerBound
public boolean isIncludeLowerBound() -
isIncludeUpperBound
public boolean isIncludeUpperBound() -
setIncludeLowerBound
public void setIncludeLowerBound(boolean includeLowerBound) -
setIncludeUpperBound
public void setIncludeUpperBound(boolean includeUpperBound) -
validate
public boolean validate(double value) -
validateMin
public boolean validateMin(double value) -
validateMax
public boolean validateMax(double value) -
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-