commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wooten (JIRA)" <j...@apache.org>
Subject [jira] Created: (LANG-579) Add new Validate methods
Date Mon, 04 Jan 2010 17:01:55 GMT
Add new Validate methods
------------------------

                 Key: LANG-579
                 URL: https://issues.apache.org/jira/browse/LANG-579
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.*
    Affects Versions: 3.0
         Environment: Java SE 5.0+
            Reporter: Michael Wooten
            Priority: Minor
             Fix For: 3.0


Expand Validate to include more specific, human readable validation for commonly validated
parameter values (so isTrue() isn't needed as often). Include new Validate methods:

matchesPattern(String string, String pattern)
throws an IllegalArgumentException stating ("The string " + string + " does not match the
pattern "  + pattern) when the provided string does not match the regular expression pattern.

matchesPattern(String string, String pattern, String message)
throws an IllegalArgumentException stating (message + string) when the provided string does
not match the regular expression pattern.

matchesPattern(String string, Pattern pattern)
throws an IllegalArgumentException stating ("The string " + string + " does not match the
pattern "  + pattern) when the provided string does not match the regular expression pattern.

matchesPattern(String string, Pattern pattern, String message)
throws an IllegalArgumentException stating (message + string) when the provided string does
not match the regular expression pattern.

inclusiveBetween(Comparable<T> start, Comparable<T> end, Comparable<T> value)
throws an IllegalArgumentException stating ("The value " + value + " is not in the specified
inclusive range of " + start + " to " + end) when the provided value does not fall between
the two comparable values (inclusive).

inclusiveBetween(Comparable<T> start, Comparable<T> end, Comparable<T> value,
String message)
throws an IllegalArgumentException stating (message + value) when the provided value does
not fall between the two comparable values (inclusive).

exclusiveBetween(Comparable<T> start, Comparable<T> end, Comparable<T> value)
throws an IllegalArgumentException stating ("The value " + value + " is not in the specified
exclusive range of " + start + " to " + end) when the provided value does not fall between
the two comparable values (exclusive).

exclusiveBetween(Comparable<T> start, Comparable<T> end, Comparable<T> value,
String message)
throws an IllegalArgumentException stating (message + value) when the provided value does
not fall between the two comparable values (exclusive).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message