Package io.deephaven.query.parameterized
Interface Parameter
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ParameterImpl,TableParameter
A single parameter to be used with a
ParameterizedQuery-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@NotNull ConstraintGet theConstraintfor this parameter.@NotNull String[]Get the default values for this parameter.@NotNull DisplayTypeGet the display hint for the control.default intgetIntProperty(@NotNull String name, int defaultValue) Get the property value as an integer, or the default value if it does not exist.@NotNull StringgetName()Get the name of the parameter@Nullable StringgetProperty(@NotNull String name) Get the value of the specified constant propertyGet the available property keys@NotNull ValueTypeThe type of this parameterbooleanhasProperty(@NotNull String name) Check if the parameter has the specified property.booleanReturn if this parameter is a collection of the specified type, as opposed to a single value.booleanCheck if this parameter is required for computation (may not be null)static @NotNull ParameterBuilderCreate an Boolean parameterstatic @NotNull ParameterBuilderofDateTime(@NotNull String name) Create an DateTime parameter (represented as a long nanos since epoch)static @NotNull ParameterBuilderCreate a double parameter.static @NotNull ParameterBuilderCreate a long parameter.static @NotNull ParameterBuilderCreate an String parameterstatic @NotNull ParameterBuilderCreate a parameter based on the specified DeephavenTableand column.static @NotNull ParameterBuildersetOfBoolean(@NotNull String name) Create a parameter that is a set of Boolean values.static @NotNull ParameterBuildersetOfDateTime(@NotNull String name) Create a parameter that is a set of Date time values (represented as long nanos since epoch)static @NotNull ParameterBuildersetOfDouble(@NotNull String name) Create a parameter that is a set of double values.static @NotNull ParameterBuilderCreate a parameter that is a set of longs.static @NotNull ParameterBuildersetOfString(@NotNull String name) Create a parameter that is a set of String values
-
Field Details
-
ZERO_LENGTH_PARAMETER_ARRAY
-
-
Method Details
-
getName
Get the name of the parameter- Returns:
- the name
-
isCollection
boolean isCollection()Return if this parameter is a collection of the specified type, as opposed to a single value.- Returns:
- true if this parameter is a set of values
-
isRequired
boolean isRequired()Check if this parameter is required for computation (may not be null)- Returns:
- true if the parameter is required
-
getValueType
The type of this parameter- Returns:
- the type
-
getDisplayType
Get the display hint for the control.- Returns:
- the display type
-
getDefaultValues
Get the default values for this parameter. A zero length array is returned when there are no defaults.- Returns:
- the default value
-
getConstraint
Get theConstraintfor this parameter.- Returns:
- the constraint or
Constraint.UNCONSTRAINEDif there are none.
-
getPropertyKeys
Get the available property keys- Returns:
- Array of property keys available to get with `getProperty`
-
hasProperty
Check if the parameter has the specified property.- Parameters:
name- the name of the property- Returns:
- true if the property exists.
-
getProperty
Get the value of the specified constant property- Parameters:
name- the name of the property to retrieve- Returns:
- the property value.
-
getIntProperty
Get the property value as an integer, or the default value if it does not exist.- Parameters:
name- the name of the propertydefaultValue- the value to return if it does not exist- Returns:
- the value of the property as an integer
- Throws:
NumberFormatException- if the property existed but was not an integer
-
ofLong
Create a long parameter.- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
setOfLong
Create a parameter that is a set of longs.- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
ofDouble
Create a double parameter.- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
setOfDouble
Create a parameter that is a set of double values.- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
ofString
Create an String parameter- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
setOfString
Create a parameter that is a set of String values- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
ofDateTime
Create an DateTime parameter (represented as a long nanos since epoch)- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
setOfDateTime
Create a parameter that is a set of Date time values (represented as long nanos since epoch)- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
ofBoolean
Create an Boolean parameter- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
setOfBoolean
Create a parameter that is a set of Boolean values.- Parameters:
name- the name of the parameter- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-
ofTable
@ScriptApi @NotNull static @NotNull ParameterBuilder ofTable(@NotNull @NotNull String name, @NotNull @NotNull Table source, @NotNull @NotNull String column) Create a parameter based on the specified DeephavenTableand column. The parameter type will be inferred by the implementation. This parameter accepts any set of unique values from the specified column.- Parameters:
name- the name of the parametersource- the source table.column- the column in the source table- Returns:
- a
ParameterBuilderto continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-