Class ParameterBuilder
java.lang.Object
io.deephaven.query.parameterized.impl.parameter.ParameterBuilder
A Builder for creating properly typed parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionParameterBuilder
(String name, Table table, String column) Create a new ParameterBuilder backed by a DeephavenTable
ParameterBuilder
(String name, ValueType valueType, boolean isSet) Create a new ParameterBuilder -
Method Summary
Modifier and TypeMethodDescriptionSet the desired display type for this parameter to be a Date Picker.Set the desired display type for this parameter to be a Date and Time Picker.Set the desired display type for this parameter to be a user editable list of items.Set the desired display type for this parameter to be a Fixed List of items.asText()
Set the desired display type for this parameter to be a Text entry.build()
Create aParameter
based on the current set of configured options.in
(byte... vals) Constrain the parameter value to be within the specified set.in
(double... vals) Constrain the parameter value to be within the specified set.in
(float... vals) Constrain the parameter value to be within the specified set.in
(int... vals) Constrain the parameter value to be within the specified set.in
(long... vals) Constrain the parameter value to be within the specified set.in
(short... vals) Constrain the parameter value to be within the specified set.in
(DBDateTime... vals) Constrain the parameter value to be within the specified set.Constrain the parameter value to be within the specified set.inRange
(double min, double max) Set the constraint of the parameter to be in the specified range.inRange
(long min, long max) Set the constraint of the parameter to be in the specified range.inRange
(DBDateTime min, DBDateTime max) optional()
Mark this parameter as optional.setProperty
(String property, String value) Set a property to be passed along with this parameter.sizeHint
(int width, int height) Set the size hints for both width and height in pixels for any UI control generated for this component.Set the tool tip for this parameter.withConstraint
(Constraint constraint) Set the constraint of this parameter.withDefault
(boolean... val) Set the default value for this parameter from a boolean.withDefault
(byte... val) Set the default value for this parameter from bytes.withDefault
(double... val) Set the default value for this parameter.withDefault
(float... val) Set the default value for this parameter from floats.withDefault
(int... val) Set the default value for this parameter from ints.withDefault
(long... val) Set the default value for this parameter from longs.withDefault
(short... val) Set the default value for this parameter from shorts.withDefault
(DBDateTime... val) Set the default value for this parameter from DBDateTimes.withDefault
(String... val) Set the default value for this parameter from Strings.
-
Constructor Details
-
ParameterBuilder
Create a new ParameterBuilder- Parameters:
name
- the name of the parametervalueType
- the type of the valueisSet
- if the parameter is a set of 'valueType' or a singular value.
-
ParameterBuilder
Create a new ParameterBuilder backed by a DeephavenTable
- Parameters:
name
- the name of the parametertable
- the tablecolumn
- the table column.
-
-
Method Details
-
withDefault
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
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
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
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
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
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
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
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
Set the default value for this parameter from a boolean.- Parameters:
val
- the set of values to make default- Returns:
- this builder
-
inRange
Set the constraint of the parameter to be in the specified range. This overload is only applicable toValueType.Double
parameters.- Parameters:
min
- the minimum value of the rangemax
- the maximum value of the range.- Returns:
- this builder
-
inRange
Set the constraint of the parameter to be in the specified range.- Parameters:
min
- the minimum value of the rangemax
- the maximum value of the range.- Returns:
- this builder
-
inRange
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
in
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 toDisplayType.DropDown
- Parameters:
vals
- the allowable values- Returns:
- this builder
-
withConstraint
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
Mark this parameter as optional.- Returns:
- this builder
-
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
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 theValueType.DateTime
type.- Returns:
- this builder
-
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 theValueType.String
type.- Returns:
- this builder
-
asFixedList
Set the desired display type for this parameter to be a Fixed List of items.- Returns:
- this builder
-
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
Set the tool tip for this parameter.- Parameters:
toolTip
- the tool tip or null to remove it.- Returns:
- this builder
-
sizeHint
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 namevalue
- the value of the property. An empty string or null will remove the property entirely.
-
build
Create aParameter
based on the current set of configured options.- Returns:
- a new
Parameter
-