You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Valentin Rocher (JIRA)" <ji...@apache.org> on 2010/02/02 16:30:19 UTC
[jira] Updated: (LANG-579) Add new Validate methods
[ https://issues.apache.org/jira/browse/LANG-579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Valentin Rocher updated LANG-579:
---------------------------------
Attachment: LANG_579.diff
Made minor modifications to the specifications :
- matchesPattern takes a CharSequence, as it's what Pattern takes
- only value needs to be Comparable<T>, or we need to make an ugly cast to use compareTo
> 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
>
> Attachments: LANG_579.diff
>
> Original Estimate: 96h
> Remaining Estimate: 96h
>
> 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.