Class QFrontendFieldValidation

java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendFieldValidation
All Implemented Interfaces:
Serializable

public class QFrontendFieldValidation extends Object implements Serializable
The validation rules of a field, in one place, as the backend enforces them on insert and update - so a client (web, CLI, TUI, native) can check a value before saving. The server stays the authority: a rule not stated here is never assumed by a client. - required: a value is required (isRequired). - maxLength + tooLongBehavior: ERROR refuses a longer value; TRUNCATE and TRUNCATE_ELLIPSIS trim it on save; PASS_THROUGH (or absent) does neither. - minValue / maxValue (+ minInclusive / maxInclusive): a value outside is refused (only ranges whose behavior is ERROR; CLIP ranges are not listed). - pattern (+ patternMessage): a non-empty value must match the whole regular expression (ValuePatternBehavior).
See Also:
  • Constructor Details

    • QFrontendFieldValidation

      public QFrontendFieldValidation()
  • Method Details

    • of

      public static QFrontendFieldValidation of(QFieldMetaData field)
      The rules of a field, or null when it has none.
    • getRequired

      public Boolean getRequired()
      Getter for required
    • getMaxLength

      public Integer getMaxLength()
      Getter for maxLength
    • getTooLongBehavior

      public String getTooLongBehavior()
      Getter for tooLongBehavior
    • getMinValue

      public String getMinValue()
      Getter for minValue
    • getMinInclusive

      public Boolean getMinInclusive()
      Getter for minInclusive
    • getMaxValue

      public String getMaxValue()
      Getter for maxValue
    • getMaxInclusive

      public Boolean getMaxInclusive()
      Getter for maxInclusive
    • getPattern

      public String getPattern()
      Getter for pattern
    • getPatternMessage

      public String getPatternMessage()
      Getter for patternMessage