Class DoubleRangeValidatingInputTable

java.lang.Object
io.deephaven.server.table.inputtables.AbstractBaseValidatingInputTable
io.deephaven.server.table.inputtables.DoubleRangeValidatingInputTable
All Implemented Interfaces:
InputTableUpdater

@TestUseOnly public class DoubleRangeValidatingInputTable extends AbstractBaseValidatingInputTable
This is an example of an InputTableUpdater that validates that the values in a Double column are within a given range.

This class wraps an existing input table, and before performing the underlying validation performs its own validation on the range of the column.

This class is intended for testing and demonstrating validation functionality, it is not production ready and may be changed or removed at any time.

  • Method Details

    • make

      public static Table make(Table input, String column, double min, double max)
      Wrap input, which must be an input table into a new input table that validates that the values in column are within the range ([min, max].
      Parameters:
      input - the table to wrap
      column - the column to validate, must be a double type
      min - the minimum value allowed, inclusive
      max - the maximum value allowed, inclusive
      Returns:
      a new input table that validates the range of column
    • getColumnRestrictions

      @Nullable public @Nullable List<com.google.protobuf.Any> getColumnRestrictions(String columnName)
      Description copied from interface: InputTableUpdater
      If there are client-side defined restrictions on this column, return them as a list of protobuf Any messages. These restrictions are used by the client for properly displaying and validating the edit field.

      The restrictions are packed as google.protobuf.Any messages, which allows for different restriction types (e.g., IntegerRangeRestriction, DoubleRangeRestriction, StringListRestriction, etc.) to be sent to the client. The client is responsible for unpacking and interpreting these restrictions.

      Specified by:
      getColumnRestrictions in interface InputTableUpdater
      Specified by:
      getColumnRestrictions in class AbstractBaseValidatingInputTable
      Parameters:
      columnName - the column name to query
      Returns:
      a list of protobuf Any messages representing the restrictions for this column, or null if no client-side restrictions are supplied for this column
    • validateAddOrModify

      public void validateAddOrModify(Table tableToApply)
      Description copied from interface: InputTableUpdater
      Helper to check if a table is compatible with this table, so that it could be added as contents.
      Specified by:
      validateAddOrModify in interface InputTableUpdater
      Specified by:
      validateAddOrModify in class AbstractBaseValidatingInputTable
      Parameters:
      tableToApply - the table to check if it can used to add or modify this input table