Package org.passay.rule
Class LengthComplexityRule.Interval
java.lang.Object
org.passay.rule.LengthComplexityRule.Interval
- Enclosing class:
- LengthComplexityRule
Class that represents an interval of numbers and parses interval notation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INTERVAL_PATTERN
Pattern for matching intervals. -
boundsPattern
Interval pattern. -
lower
private final int lowerLower bound of the interval (inclusive). -
upper
private final int upperUpper bound of the interval (inclusive).
-
-
Constructor Details
-
Interval
Interval(String pattern) Creates a new interval.- Parameters:
pattern- to parse
-
-
Method Details
-
includes
public boolean includes(int i) Returns whether this interval includes the supplied integer.- Parameters:
i- to test for inclusion- Returns:
- whether this interval includes the supplied integer
-
intersects
Returns whether this interval intersects the supplied interval.- Parameters:
i- interval to test for intersection- Returns:
- whether this interval intersects the supplied interval
-
toString
-