Class RangedIntegerValidator

  • All Implemented Interfaces:
    ValueValidator
    Direct Known Subclasses:
    PortValidator

    public class RangedIntegerValidator
    extends java.lang.Object
    implements ValueValidator
    Checks that the value is an Integer or Long (or a String representation of one) that is within a desired range).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int high  
      private int low  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPossibleValues()
      Returns a string describing possible values in human-readable form that this ValueValidator accepts
      void validate​(java.lang.Object value)
      This method checks if the given object is a valid value for this specific ValueValidator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • low

        private final int low
      • high

        private final int high
    • Constructor Detail

      • RangedIntegerValidator

        public RangedIntegerValidator​(int low,
                                      int high)
    • Method Detail

      • validate

        public void validate​(java.lang.Object value)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: ValueValidator
        This method checks if the given object is a valid value for this specific ValueValidator. Any arbitrary operation can be performed to ensure that the value is valid.
        Specified by:
        validate in interface ValueValidator
        Parameters:
        value - The object to validate
        Throws:
        java.lang.IllegalArgumentException - if the value is invalid