Class RangeValidator<T extends Comparable>

    • Constructor Detail

      • RangeValidator

        public RangeValidator​(String errorMessage,
                              Class<T> type,
                              T minValue,
                              T maxValue)
        Deprecated.
        Creates a new range validator of the given type.
        Parameters:
        errorMessage - The error message to use if validation fails
        type - The type of object the validator can validate.
        minValue - The minimum value that should be accepted or null for no limit
        maxValue - The maximum value that should be accepted or null for no limit
    • Method Detail

      • isMinValueIncluded

        public boolean isMinValueIncluded()
        Deprecated.
        Checks if the minimum value is part of the accepted range.
        Returns:
        true if the minimum value is part of the range, false otherwise
      • setMinValueIncluded

        public void setMinValueIncluded​(boolean minValueIncluded)
        Deprecated.
        Sets if the minimum value is part of the accepted range.
        Parameters:
        minValueIncluded - true if the minimum value should be part of the range, false otherwise
      • isMaxValueIncluded

        public boolean isMaxValueIncluded()
        Deprecated.
        Checks if the maximum value is part of the accepted range.
        Returns:
        true if the maximum value is part of the range, false otherwise
      • setMaxValueIncluded

        public void setMaxValueIncluded​(boolean maxValueIncluded)
        Deprecated.
        Sets if the maximum value is part of the accepted range.
        Parameters:
        maxValueIncluded - true if the maximum value should be part of the range, false otherwise
      • getMinValue

        public T getMinValue()
        Deprecated.
        Gets the minimum value of the range.
        Returns:
        the minimum value
      • setMinValue

        public void setMinValue​(T minValue)
        Deprecated.
        Sets the minimum value of the range. Use setMinValueIncluded(boolean) to control whether this value is part of the range or not.
        Parameters:
        minValue - the minimum value
      • getMaxValue

        public T getMaxValue()
        Deprecated.
        Gets the maximum value of the range.
        Returns:
        the maximum value
      • setMaxValue

        public void setMaxValue​(T maxValue)
        Deprecated.
        Sets the maximum value of the range. Use setMaxValueIncluded(boolean) to control whether this value is part of the range or not.
        Parameters:
        maxValue - the maximum value
      • isValidValue

        protected boolean isValidValue​(T value)
        Deprecated.
        Description copied from class: AbstractValidator
        Internally check the validity of a value. This method can be used to perform validation in subclasses if customization of the error message is not needed. Otherwise, subclasses should override AbstractValidator.validate(Object) and the return value of this method is ignored. This method should not be called from outside the validator class itself.
        Specified by:
        isValidValue in class AbstractValidator<T extends Comparable>
        Returns: