Class LengthValidator

  • All Implemented Interfaces:
    no.acntech.easycontainers.util.lang.Validator

    
    public final class LengthValidator
     implements Validator<String>
                        

    A validator that forces a string to be of a certain length.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Integer min
      private final Integer max
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer getMin() The minimum length of the string.
      final Integer getMax() The maximum length of the string.
      Unit validate(String t) Validates the given object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getMin

         final Integer getMin()

        The minimum length of the string.

      • getMax

         final Integer getMax()

        The maximum length of the string.

      • validate

         Unit validate(String t)

        Validates the given object.

        Parameters:
        t - the object to validate