Class ParameterBuilder

java.lang.Object
io.deephaven.query.parameterized.impl.parameter.ParameterBuilder

public class ParameterBuilder extends Object
A Builder for creating properly typed parameters.
  • Constructor Details

    • ParameterBuilder

      public ParameterBuilder(String name, ValueType valueType, boolean isSet)
      Create a new ParameterBuilder
      Parameters:
      name - the name of the parameter
      valueType - the type of the value
      isSet - if the parameter is a set of 'valueType' or a singular value.
    • ParameterBuilder

      public ParameterBuilder(String name, Table table, String column)
      Create a new ParameterBuilder backed by a Deephaven Table
      Parameters:
      name - the name of the parameter
      table - the table
      column - the table column.
  • Method Details

    • withDefault

      @ScriptApi public ParameterBuilder withDefault(byte... val)
      Set the default value for this parameter from bytes. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(short... val)
      Set the default value for this parameter from shorts. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(int... val)
      Set the default value for this parameter from ints. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(long... val)
      Set the default value for this parameter from longs. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(float... val)
      Set the default value for this parameter from floats. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(double... val)
      Set the default value for this parameter. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(String... val)
      Set the default value for this parameter from Strings. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(DBDateTime... val)
      Set the default value for this parameter from DBDateTimes. Multiple values may only be provided if the parameter is a 'set' type.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • withDefault

      @ScriptApi public ParameterBuilder withDefault(boolean... val)
      Set the default value for this parameter from a boolean.
      Parameters:
      val - the set of values to make default
      Returns:
      this builder
    • inRange

      @ScriptApi public ParameterBuilder inRange(double min, double max)
      Set the constraint of the parameter to be in the specified range. This overload is only applicable to ValueType.Double parameters.
      Parameters:
      min - the minimum value of the range
      max - the maximum value of the range.
      Returns:
      this builder
    • inRange

      @ScriptApi public ParameterBuilder inRange(long min, long max)
      Set the constraint of the parameter to be in the specified range.
      Parameters:
      min - the minimum value of the range
      max - the maximum value of the range.
      Returns:
      this builder
    • inRange

      public ParameterBuilder inRange(DBDateTime min, DBDateTime max)
    • in

      @ScriptApi public ParameterBuilder in(byte... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(short... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(int... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(long... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(float... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(double... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(String... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • in

      @ScriptApi public ParameterBuilder in(DBDateTime... vals)
      Constrain the parameter value to be within the specified set. If a display type has not be explicitly set this will automatically change the display type to DisplayType.DropDown
      Parameters:
      vals - the allowable values
      Returns:
      this builder
    • withConstraint

      @ScriptApi public ParameterBuilder withConstraint(@Nullable Constraint constraint)
      Set the constraint of this parameter. Invoking this will override any previously set constraint.
      Parameters:
      constraint - the new constraint (null can be used for no constraint)
      Returns:
      this builder
    • optional

      @ScriptApi public ParameterBuilder optional()
      Mark this parameter as optional.
      Returns:
      this builder
    • asText

      @ScriptApi public ParameterBuilder asText()
      Set the desired display type for this parameter to be a Text entry. This option is not compatible with 'set' parameters,
      Returns:
      this builder
    • asDateTimePicker

      @ScriptApi public ParameterBuilder asDateTimePicker()
      Set the desired display type for this parameter to be a Date and Time Picker. This option is not compatible with 'set' parameters, and only supports the ValueType.DateTime type.
      Returns:
      this builder
    • asDatePicker

      @ScriptApi public ParameterBuilder asDatePicker()
      Set the desired display type for this parameter to be a Date Picker. This option is not compatible with 'set' parameters, and only supports the ValueType.String type.
      Returns:
      this builder
    • asFixedList

      @ScriptApi public ParameterBuilder asFixedList()
      Set the desired display type for this parameter to be a Fixed List of items.
      Returns:
      this builder
    • asEditableList

      @ScriptApi public ParameterBuilder asEditableList()
      Set the desired display type for this parameter to be a user editable list of items. Note that this option is only allowed with 'set' types
      Returns:
      this builder
    • toolTip

      @NotNull @ScriptApi public ParameterBuilder toolTip(@Nullable String toolTip)
      Set the tool tip for this parameter.
      Parameters:
      toolTip - the tool tip or null to remove it.
      Returns:
      this builder
    • sizeHint

      @NotNull @ScriptApi public ParameterBuilder sizeHint(int width, int height)
      Set the size hints for both width and height in pixels for any UI control generated for this component. A value of -1 for either width or height will allow the control to size itself.
      Parameters:
      width - the width hint or <= 0 for default (in pixels)
      height - the height hint or <= 0 for default (in pixels)
      Returns:
      this builder
    • setProperty

      @ScriptApi @NotNull public ParameterBuilder setProperty(@NotNull String property, @Nullable String value)
      Set a property to be passed along with this parameter.
      Parameters:
      property - the property name
      value - the value of the property. An empty string or null will remove the property entirely.
    • build

      @ScriptApi public Parameter build()
      Create a Parameter based on the current set of configured options.
      Returns:
      a new Parameter