Description
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).