Interface LengthValidator

All Superinterfaces:
Cloneable, Validator, ValueValidator
All Known Implementing Classes:
LengthValidatorImpl

public interface LengthValidator extends ValueValidator
Verifies that the length of a string is within the borders specified (min/max).

TODO Should the LengthValidator be allowed for non-string types? For example numbers have a max length too, but it's catched with ranges already. Other data types could just use the string representation. For now only string is permitted, otherwise IllegalArgumentException.

  • Method Details

    • init

      void init(@Nullable @Nullable Integer fromIncluding, @Nullable @Nullable Integer toIncluding)
    • getFromIncluding

      @Nullable @Nullable Integer getFromIncluding()
      Returns the length min value which is valid including this value, or null if none specified.
    • getToIncluding

      @Nullable @Nullable Integer getToIncluding()
      Returns the length max value which is valid including this value, or null if none specified.