Class Validation

java.lang.Object
io.keikai.axyra.sheets.content.Validation

public final class Validation extends Object
A data-validation rule (immutable). Apply with Range.setValidation(...); read back with Sheet.validations(). Crosses the boundary as flat JSON.

Types: whole, decimal, list, date, time, textLength, custom. Operators: between, notBetween, equal, notEqual, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual.

  • Method Details

    • list

      public static Validation list(String... items)
      A dropdown list of the given allowed values.
    • wholeNumber

      public static Validation wholeNumber(String operator, String formula1, String formula2)
      A whole-number constraint (e.g. wholeNumber("between", "1", "10")).
    • decimal

      public static Validation decimal(String operator, String formula1, String formula2)
      A decimal constraint.
    • date

      public static Validation date(String operator, String formula1, String formula2)
      A date constraint (e.g. date("between", "2020-01-01", "2020-12-31")).
    • time

      public static Validation time(String operator, String formula1, String formula2)
      A time constraint.
    • textLength

      public static Validation textLength(String operator, String formula1, String formula2)
      A text-length constraint (e.g. textLength("lessThanOrEqual", "50", null)).
    • custom

      public static Validation custom(String formula)
      A custom-formula constraint.
    • builder

      public static Validation.Builder builder()
    • toBuilder

      public Validation.Builder toBuilder()
      A builder pre-loaded with this rule, for read–modify–write round-trips.
    • toJson

      public String toJson()
    • fromJson

      public static Validation fromJson(String json)
    • type

      public String type()
    • operator

      public String operator()
    • formula1

      public String formula1()
    • formula2

      public String formula2()
    • allowBlank

      public boolean allowBlank()
    • showDropdown

      public boolean showDropdown()
      Whether a list rule offers its items as an in-cell drop-down.
    • errorStyle

      public String errorStyle()
      How firmly a failure is reported: stop/warning/information.
    • errorTitle

      public String errorTitle()
    • errorMessage

      public String errorMessage()
    • showErrorMessage

      public boolean showErrorMessage()
    • inputTitle

      public String inputTitle()
    • inputMessage

      public String inputMessage()
    • showInputMessage

      public boolean showInputMessage()
    • firstRow

      public int firstRow()
      The rectangle this rule applies to (0-based, from a read-back rule).
    • firstColumn

      public int firstColumn()
    • lastRow

      public int lastRow()
    • lastColumn

      public int lastColumn()