Class QualificationBuilder
java.lang.Object
com.emc.documentum.rest.dfc.query.QualificationBuilder
A builder to construct the DQL qualification.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionand()
Append an "AND" without any condition to the qualification Typically, this will be used together with methodsp
andq
below to append a complex OR conditionAppend an "AND" condition to the qualificationbuild()
Build the qualification string according to conditions providedAppend a condition to the qualificationinitialOrAndCondition
(String condition, Object... args) Sometimes, when a condition is added to the qualification, an "AND" should be added if this is NOT the initial condition in the qualification.Append multiple conditions joined by OR, each variable in variables will be used in the condition template to be a formatted string and joined by OR later For example,qualification.or("X.%s", Arrays.asList("1", "2"))
will give rise to a joined OR condition like "X.1 OR X.2"p()
Append an open parenthesis '(' to the qualificationq()
Append a closed parenthesis ')' to the qualification
-
Constructor Details
-
QualificationBuilder
public QualificationBuilder()
-
-
Method Details
-
condition
Append a condition to the qualification- Parameters:
condition
- a condition templateargs
- arguments for the condition template, the arguments will always be SQL escaped- Returns:
- the QualificationBuilder
-
and
Append an "AND" without any condition to the qualification Typically, this will be used together with methodsp
andq
below to append a complex OR condition- Returns:
- the QualificationBuilder
-
initialOrAndCondition
Sometimes, when a condition is added to the qualification, an "AND" should be added if this is NOT the initial condition in the qualification. and "AND" should NOT be added if this is the initial condition of the qualification. This method will add a condition to the qualification according to the current status of the qualification: if the qualification is still in initial status (no condition has been appended yet), "AND" will not be appended, otherwise, "AND" will be appended together with the formatted condition. It is recommended to add the mandatory condition first to the qualification usingQualificationBuilder.condition
, and useQualificationBuilder.and
later. While if there is no mandatory condition and all conditions are optional, we could use this method- Parameters:
condition
- a condition templateargs
- arguments for the condition template, the arguments will always be SQL escaped- Returns:
- the QualificationBuilder
-
and
Append an "AND" condition to the qualification- Parameters:
condition
- a condition templateargs
- arguments for the condition template, the arguments will always be SQL escaped- Returns:
- the QualificationBuilder
-
p
Append an open parenthesis '(' to the qualification- Returns:
- the QualificationBuilder
-
q
Append a closed parenthesis ')' to the qualification- Returns:
- the QualificationBuilder
-
or
Append multiple conditions joined by OR, each variable in variables will be used in the condition template to be a formatted string and joined by OR later For example,qualification.or("X.%s", Arrays.asList("1", "2"))
will give rise to a joined OR condition like "X.1 OR X.2"- Parameters:
condition
- the condition templatevariables
- a list of variables, and each of which will be used in the condition template- Returns:
- a joined OR conditions
-
build
Build the qualification string according to conditions provided- Returns:
- the qualification string
-