Class LengthComplexityRule.Interval

java.lang.Object
org.passay.rule.LengthComplexityRule.Interval
Enclosing class:
LengthComplexityRule

public static class LengthComplexityRule.Interval extends Object
Class that represents an interval of numbers and parses interval notation.
  • Field Details

    • INTERVAL_PATTERN

      private static final Pattern INTERVAL_PATTERN
      Pattern for matching intervals.
    • boundsPattern

      private final String boundsPattern
      Interval pattern.
    • lower

      private final int lower
      Lower bound of the interval (inclusive).
    • upper

      private final int upper
      Upper 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

      public boolean intersects(LengthComplexityRule.Interval i)
      Returns whether this interval intersects the supplied interval.
      Parameters:
      i - interval to test for intersection
      Returns:
      whether this interval intersects the supplied interval
    • toString

      public String toString()
      Overrides:
      toString in class Object