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 TypeMethodDescriptionGet theConstraintfor this parameter.String[]Get the default values for this parameter.Get the display hint for the control.default intgetIntProperty(String name, int defaultValue) Get the property value as an integer, or the default value if it does not exist.getName()Get the name of the parametergetProperty(String name) Get the value of the specified constant propertyGet the available property keysThe type of this parameterbooleanhasProperty(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 ParameterBuilderCreate an Boolean parameterstatic ParameterBuilderofDateTime(String name) Create an DateTime parameter (represented as a long nanos since epoch)static ParameterBuilderCreate a double parameter.static ParameterBuilderCreate a long parameter.static ParameterBuilderCreate an String parameterstatic ParameterBuilderCreate a parameter based on the specified DeephavenTableand column.static ParameterBuildersetOfBoolean(String name) Create a parameter that is a set of Boolean values.static ParameterBuildersetOfDateTime(String name) Create a parameter that is a set of Date time values (represented as long nanos since epoch)static ParameterBuildersetOfDouble(String name) Create a parameter that is a set of double values.static ParameterBuilderCreate a parameter that is a set of longs.static ParameterBuildersetOfString(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 ParameterBuilder ofTable(@NotNull String name, @NotNull Table source, @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)
-