@NotFinalAPI public interface QueryParameters
CompletePropertyCondition
) or even
replace those named conditions completely (using addConditionReplacement(java.lang.String, com.hp.ucmdb.api.topology.ConditionExpression<com.hp.ucmdb.api.topology.CompletePropertyCondition, com.hp.ucmdb.api.topology.PropertiesConditionOperand>)
).
The addValueXXX methods adds a name and value pair to a the map. The name is the name of the condition set at query
creation time. The value (or values) are the replacement for the original value set (if any existed) in the query.
Using a name that does not appear in the value will not cause exceptions, but will also not change the query runtime
behavior.
The addConditionReplacement(java.lang.String, com.hp.ucmdb.api.topology.ConditionExpression<com.hp.ucmdb.api.topology.CompletePropertyCondition, com.hp.ucmdb.api.topology.PropertiesConditionOperand>)
method replaces the entire named condition with the provided condition. The new
condition can be created using the builder
.
Note: all value type checks are done in the api server, not in the client layer. Incompatible or incomplete
parameters will cause a validation exception to be thrown.Modifier and Type | Method and Description |
---|---|
QueryParameters |
addConditionReplacement(String name,
ConditionExpression<CompletePropertyCondition,PropertiesConditionOperand> condition)
Adds a condition expression to replace the named condition.
|
QueryParameters |
addQueryParameter(String name,
QueryParameter queryParameter)
Adds the given query parameter to the this query parameters.
|
QueryParameters |
addValue(String name,
Object value)
Adds a single value.
|
QueryParameters |
addValues(String name,
Collection<?> valueCollection)
Adds a series of values.
|
QueryParameters |
addValuesInRange(String name,
Object lowValue,
Object highValue)
Adds range in-boundries using low and high values.
|
QueryParameters |
addValuesOutOfRange(String name,
Object lowValue,
Object highValue)
Adds range out-boundries using low and high values.
|
PropertyConditionBuilder |
createConditionBuilder() |
boolean |
isEmpty() |
Map<String,QueryParameter> |
parametersMap() |
QueryParameters addValue(String name, Object value)
ExecutableQuery executableQuery = topologyQueryService.createExecutableQuery(queryName); ArrayListparameterValue = new ArrayList (); parameterValue.add("value1"); parameterValue.add("value2"); executableQuery.queryParameters().addValue("conditionNote", parameterValue); topologyQueryService.executeQuery(executableQuery);
name
- the name of the condition the value is to fill.value
- the execution value.QueryParameters addValues(String name, Collection<?> valueCollection)
ExecutableQuery executableQuery = topologyQueryService.createExecutableQuery(queryName); ArrayListThis will be the same as using addValue method:parameterValue = new ArrayList (); parameterValue.add("value1"); parameterValue.add("value2"); executableQuery.queryParameters().addValues("conditionNote", parameterValue); topologyQueryService.executeQuery(executableQuery);
executableQuery.queryParameters().addValue("conditionNote", parameterValue);If the condition does not support collections it will be replaced with a condition expression composed of copies of the original condition, each with a single value from the collection, "or"-ed with each other (so that any value from the collection can be a match). Here is an example of adding values for an executable query with a "contains" condition on "nodeRole" attribute of string list type. This will be converted in a condition that has the "or" operator : nodeRole contains value1 or nodeRole contains value2.
ExecutableQuery executableQuery = topologyQueryService.createExecutableQuery(queryName); ArrayListparameterValue = new ArrayList (); parameterValue.add("value1"); parameterValue.add("value2"); executableQuery.queryParameters().addValues("conditionNodeRole", parameterValue); topologyQueryService.executeQuery(executableQuery);
name
- the name of the condition the value is to fill.valueCollection
- the values collections.QueryParameters addValuesInRange(String name, Object lowValue, Object highValue)
name
- the name of the condition the value is to fill.lowValue
- the execution low value.highValue
- the execution high value.QueryParameters addValuesOutOfRange(String name, Object lowValue, Object highValue)
name
- the name of the condition the value is to fill.lowValue
- the execution low value.highValue
- the execution high value.QueryParameters addConditionReplacement(String name, ConditionExpression<CompletePropertyCondition,PropertiesConditionOperand> condition)
createConditionBuilder()
.name
- the name of the condition the value is to fill.condition
- the replacing condition expression.QueryParameters addQueryParameter(String name, QueryParameter queryParameter)
name
- the name of the condition the parameter refers to.queryParameter
- the query parameter.PropertyConditionBuilder createConditionBuilder()
Map<String,QueryParameter> parametersMap()
boolean isEmpty()
Documentation Feedback
Copyright 2011 - 2018 Micro Focus or one of its affiliates.