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 theConstraint
for this parameter.String[]
Get the default values for this parameter.Get the display hint for the control.default int
getIntProperty
(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 parameterboolean
hasProperty
(String name) Check if the parameter has the specified property.boolean
Return if this parameter is a collection of the specified type, as opposed to a single value.boolean
Check if this parameter is required for computation (may not be null)static ParameterBuilder
Create an Boolean parameterstatic ParameterBuilder
ofDateTime
(String name) Create an DateTime parameter (represented as a long nanos since epoch)static ParameterBuilder
Create a double parameter.static ParameterBuilder
Create a long parameter.static ParameterBuilder
Create an String parameterstatic ParameterBuilder
Create a parameter based on the specified DeephavenTable
and column.static ParameterBuilder
setOfBoolean
(String name) Create a parameter that is a set of Boolean values.static ParameterBuilder
setOfDateTime
(String name) Create a parameter that is a set of Date time values (represented as long nanos since epoch)static ParameterBuilder
setOfDouble
(String name) Create a parameter that is a set of double values.static ParameterBuilder
Create a parameter that is a set of longs.static ParameterBuilder
setOfString
(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 theConstraint
for this parameter.- Returns:
- the constraint or
Constraint.UNCONSTRAINED
if 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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
ParameterBuilder
to 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 DeephavenTable
and 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
ParameterBuilder
to continue the definition. This may be passed directly toParameterizedQueryBuilder.with(ParameterBuilder)
-