Class Conditional.ConditionalBuilder
java.lang.Object
com.github.tadukoo.database.mysql.syntax.conditional.Conditional.ConditionalBuilder
- All Implemented Interfaces:
Conditional.Build
,Conditional.FirstCondition
,Conditional.Operator
,Conditional.OperatorOrBuild
,Conditional.SecondCondition
- Enclosing class:
- Conditional
public static class Conditional.ConditionalBuilder
extends Object
implements Conditional.FirstCondition, Conditional.OperatorOrBuild, Conditional.SecondCondition
Conditional Builder is used to build a
Conditional
. It takes the following parameters:
Parameter | Description | Default or Required |
---|---|---|
firstCond | The first Conditional involved (it may be null if a ConditionalStatement
is used instead) |
Defaults to null (must specify this or firstCondStmt) |
firstCondStmt | The first ConditionalStatement involved (it may be null if a Conditional
is used instead) |
Defaults to null (must specify this or firstCond) |
operator | The operator for the conditional (it may be null if we have
just one condition) |
Defaults to null (required if you specify secondCond or secondCondStmt) |
secondCond | The second Conditional involved (it may be null if either a ConditionalStatement
is used instead or if there's only one condition) |
Defaults to null |
secondCondStmt | The second ConditionalStatement involved (it may be null if either a Conditional
is used instead or if there's only one condition) |
Defaults to null |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprivate Conditional
The firstConditional
involved (it may be null if aConditionalStatement
is used instead)private ConditionalStatement
The firstConditionalStatement
involved (it may be null if aConditional
is used instead)private SQLConjunctiveOperator
Theoperator
for the conditional (it may be null if we have just one condition)private Conditional
The secondConditional
involved (it may be null if either aConditionalStatement
is used instead or if there's only one condition)private ConditionalStatement
The secondConditionalStatement
involved (it may be null if either aConditional
is used instead or if there's only one condition) -
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to instantiate outside Conditional -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs a newConditional
with the set parameters after checking for errorsprivate void
Checks for any errors in the set parametersfirstCond
(Conditional firstCond) firstCondStmt
(ConditionalStatement firstCondStmt) operator
(SQLConjunctiveOperator operator) secondCond
(Conditional secondCond) secondCondStmt
(ConditionalStatement secondCondStmt)
-
Field Details
-
firstCond
The firstConditional
involved (it may be null if aConditionalStatement
is used instead) -
firstCondStmt
The firstConditionalStatement
involved (it may be null if aConditional
is used instead) -
operator
Theoperator
for the conditional (it may be null if we have just one condition) -
secondCond
The secondConditional
involved (it may be null if either aConditionalStatement
is used instead or if there's only one condition) -
secondCondStmt
The secondConditionalStatement
involved (it may be null if either aConditional
is used instead or if there's only one condition)
-
-
Constructor Details
-
ConditionalBuilder
private ConditionalBuilder()Not allowed to instantiate outside Conditional
-
-
Method Details
-
firstCond
- Specified by:
firstCond
in interfaceConditional.FirstCondition
- Parameters:
firstCond
- The firstConditional
involved (it may be null if aConditionalStatement
is used instead)- Returns:
- this, to continue building
-
firstCondStmt
- Specified by:
firstCondStmt
in interfaceConditional.FirstCondition
- Parameters:
firstCondStmt
- The firstConditionalStatement
involved (it may be null if aConditional
is used instead)- Returns:
- this, to continue building
-
operator
- Specified by:
operator
in interfaceConditional.Operator
- Parameters:
operator
- Theoperator
for the conditional (it may be null if we have just one condition)- Returns:
- this, to continue building
-
secondCond
- Specified by:
secondCond
in interfaceConditional.SecondCondition
- Parameters:
secondCond
- The secondConditional
involved (it may be null if either aConditionalStatement
is used instead or if there's only one condition)- Returns:
- this, to continue building
-
secondCondStmt
- Specified by:
secondCondStmt
in interfaceConditional.SecondCondition
- Parameters:
secondCondStmt
- The secondConditionalStatement
involved (it may be null if either aConditional
is used instead or if there's only one condition)- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for any errors in the set parameters -
build
Constructs a newConditional
with the set parameters after checking for errors- Specified by:
build
in interfaceConditional.Build
- Returns:
- The newly built
Conditional
-