Package com.example.common.validate
Class RangeNumberValidation
java.lang.Object
com.example.common.validate.BaseValidator
com.example.common.validate.RangeNumberValidation
- All Implemented Interfaces:
ValidatorInterface
The RangeNumberValidation class extends the BaseValidator class and implements the ValidatorInterface for
validating a number within a specific range.
-
Field Summary
Fields inherited from class com.example.common.validate.BaseValidator
value
-
Constructor Summary
ConstructorsConstructorDescriptionRangeNumberValidation
(String value, int min, int max) Constructs a RangeNumberValidation object with the specified value, minimum, and maximum values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
validate()
Validates whether the value falls within the specified range.
-
Constructor Details
-
RangeNumberValidation
Constructs a RangeNumberValidation object with the specified value, minimum, and maximum values.- Parameters:
value
- the value to validatemin
- the minimum value of the rangemax
- the maximum value of the range
-
-
Method Details
-
validate
public boolean validate()Validates whether the value falls within the specified range.- Specified by:
validate
in interfaceValidatorInterface
- Returns:
- true if the value is within the range, false otherwise
-