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
FieldsModifier and TypeFieldDescriptionprivate ConditionalThe firstConditionalinvolved (it may be null if aConditionalStatementis used instead)private ConditionalStatementThe firstConditionalStatementinvolved (it may be null if aConditionalis used instead)private SQLConjunctiveOperatorTheoperatorfor the conditional (it may be null if we have just one condition)private ConditionalThe secondConditionalinvolved (it may be null if either aConditionalStatementis used instead or if there's only one condition)private ConditionalStatementThe secondConditionalStatementinvolved (it may be null if either aConditionalis used instead or if there's only one condition) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to instantiate outside Conditional -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs a newConditionalwith the set parameters after checking for errorsprivate voidChecks 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 firstConditionalinvolved (it may be null if aConditionalStatementis used instead) -
firstCondStmt
The firstConditionalStatementinvolved (it may be null if aConditionalis used instead) -
operator
Theoperatorfor the conditional (it may be null if we have just one condition) -
secondCond
The secondConditionalinvolved (it may be null if either aConditionalStatementis used instead or if there's only one condition) -
secondCondStmt
The secondConditionalStatementinvolved (it may be null if either aConditionalis 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:
firstCondin interfaceConditional.FirstCondition- Parameters:
firstCond- The firstConditionalinvolved (it may be null if aConditionalStatementis used instead)- Returns:
- this, to continue building
-
firstCondStmt
- Specified by:
firstCondStmtin interfaceConditional.FirstCondition- Parameters:
firstCondStmt- The firstConditionalStatementinvolved (it may be null if aConditionalis used instead)- Returns:
- this, to continue building
-
operator
- Specified by:
operatorin interfaceConditional.Operator- Parameters:
operator- Theoperatorfor the conditional (it may be null if we have just one condition)- Returns:
- this, to continue building
-
secondCond
- Specified by:
secondCondin interfaceConditional.SecondCondition- Parameters:
secondCond- The secondConditionalinvolved (it may be null if either aConditionalStatementis used instead or if there's only one condition)- Returns:
- this, to continue building
-
secondCondStmt
- Specified by:
secondCondStmtin interfaceConditional.SecondCondition- Parameters:
secondCondStmt- The secondConditionalStatementinvolved (it may be null if either aConditionalis 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 newConditionalwith the set parameters after checking for errors- Specified by:
buildin interfaceConditional.Build- Returns:
- The newly built
Conditional
-