Class LengthIsInRange

java.lang.Object
cdc.validation.checkers.defaults.AbstractStringChecker
cdc.validation.checkers.defaults.LengthIsInRange
All Implemented Interfaces:
Checker<String>, Predicate<String>

public class LengthIsInRange extends AbstractStringChecker
Check that the length of string is in a given range.
Author:
Damien Carbonne
  • Field Details

  • Constructor Details

    • LengthIsInRange

      public LengthIsInRange(int min, int max)
  • Method Details

    • of

      public static LengthIsInRange of(int min, int max)
    • test

      public boolean test(String value)
    • explain

      public String explain(boolean result, String arg)
      Description copied from interface: Checker
      Explains the conditions at which a positive or negative result is obtained.
      Parameters:
      result - The result to explain.
      arg - The argument name to use in explanations.
      Returns:
      A string explaining the conditions leading to result.
    • getMin

      public int getMin()
    • getMax

      public int getMax()