commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlel...@apache.org
Subject cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator GenericValidator.java
Date Tue, 26 Aug 2003 16:11:01 GMT
rleland     2003/08/26 09:11:01

  Modified:    validator/src/share/org/apache/commons/validator
                        GenericValidator.java
  Log:
  Bug#:	21034 Patch submitted by Adam Kramer
  Add isInRange for byte and long
  
  Revision  Changes    Path
  1.27      +32 -8     jakarta-commons/validator/src/share/org/apache/commons/validator/GenericValidator.java
  
  Index: GenericValidator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/GenericValidator.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- GenericValidator.java	21 Aug 2003 21:43:05 -0000	1.26
  +++ GenericValidator.java	26 Aug 2003 16:11:01 -0000	1.27
  @@ -203,10 +203,22 @@
       }
   
       /**
  +	* <p>Checks if a value is within a range (min &amp; max specified
  +	* in the vars attribute).</p>
  +	*
  +	* @param 	value 		The value validation is being performed on.
  +	* @param 	min		The minimum value of the range.
  +	* @param 	max		The maximum value of the range.
  +	*/
  +   public static boolean isInRange(byte value, byte min, byte max) {
  +	  return ((value >= min) && (value <= max));
  +   }
  +
  +    /**
        * <p>Checks if a value is within a range (min &amp; max specified
        * in the vars attribute).</p>
        *
  -     * @param     value         The value validation is being performed on.
  +     * @param     value      The value validation is being performed on.
        * @param     min        The minimum value of the range.
        * @param     max        The maximum value of the range.
        */
  @@ -218,7 +230,7 @@
        * <p>Checks if a value is within a range (min &amp; max specified
        * in the vars attribute).</p>
        *
  -     * @param     value         The value validation is being performed on.
  +     * @param     value      The value validation is being performed on.
        * @param     min        The minimum value of the range.
        * @param     max        The maximum value of the range.
        */
  @@ -230,7 +242,7 @@
        * <p>Checks if a value is within a range (min &amp; max specified
        * in the vars attribute).</p>
        *
  -     * @param     value         The value validation is being performed on.
  +     * @param     value      The value validation is being performed on.
        * @param     min        The minimum value of the range.
        * @param     max        The maximum value of the range.
        */
  @@ -238,11 +250,23 @@
           return ((value >= min) && (value <= max));
       }
   
  +   /**
  +    * <p>Checks if a value is within a range (min &amp; max specified
  +    * in the vars attribute).</p>
  +    *
  +    * @param 	value 		The value validation is being performed on.
  +    * @param 	min		The minimum value of the range.
  +    * @param 	max		The maximum value of the range.
  +    */
  +   public static boolean isInRange(long value, long min, long max) {
  +      return ((value >= min) && (value <= max));
  +   }
  +
       /**
        * <p>Checks if a value is within a range (min &amp; max specified
        * in the vars attribute).</p>
        *
  -     * @param     value         The value validation is being performed on.
  +     * @param     value      The value validation is being performed on.
        * @param     min        The minimum value of the range.
        * @param     max        The maximum value of the range.
        */
  
  
  

Mime
View raw message