Class RangeNumberValidation

java.lang.Object
com.example.common.validate.BaseValidator
com.example.common.validate.RangeNumberValidation
All Implemented Interfaces:
ValidatorInterface

public class RangeNumberValidation extends BaseValidator implements ValidatorInterface
The RangeNumberValidation class extends the BaseValidator class and implements the ValidatorInterface for validating a number within a specific range.
  • Constructor Details

    • RangeNumberValidation

      public RangeNumberValidation(String value, int min, int max)
      Constructs a RangeNumberValidation object with the specified value, minimum, and maximum values.
      Parameters:
      value - the value to validate
      min - the minimum value of the range
      max - 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 interface ValidatorInterface
      Returns:
      true if the value is within the range, false otherwise