Class ConditionalStatement.ConditionStatementBuilder
java.lang.Object
com.github.tadukoo.database.mysql.syntax.conditional.ConditionalStatement.ConditionStatementBuilder
- All Implemented Interfaces:
ConditionalStatement.Build,ConditionalStatement.Column,ConditionalStatement.Operator,ConditionalStatement.Value
- Enclosing class:
- ConditionalStatement
public static class ConditionalStatement.ConditionStatementBuilder
extends Object
implements ConditionalStatement.Column, ConditionalStatement.Operator, ConditionalStatement.Value, ConditionalStatement.Build
A builder to create a
ConditionalStatement. It takes the following parameters:
| Parameter | Description | Required or Default |
|---|---|---|
| negated | Whether the statement is negated or not | Defaults to false |
| column | A column reference to the column of the statement |
Required |
| operator | The operator of the statement |
Required |
| value | The value of the statement | Required |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to instantiate outside ConditionalStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newConditionalStatementusing the set parametersprivate voidChecks for any errors in the set parametersnegated()Sets negated to true for the statementnegated(boolean negated) operator(SQLOperator operator)
-
Field Details
-
Constructor Details
-
ConditionStatementBuilder
private ConditionStatementBuilder()Not allowed to instantiate outside ConditionalStatement
-
-
Method Details
-
negated
- Specified by:
negatedin interfaceConditionalStatement.Column- Parameters:
negated- Whether the statement is negated or not- Returns:
- this, to continue building
-
negated
Sets negated to true for the statement- Specified by:
negatedin interfaceConditionalStatement.Column- Returns:
- this, to continue building
-
column
- Specified by:
columnin interfaceConditionalStatement.Column- Parameters:
column- TheColumnRefto the column of the statement- Returns:
- this, to continue building
-
operator
- Specified by:
operatorin interfaceConditionalStatement.Operator- Parameters:
operator- Theoperatorof the statement- Returns:
- this, to continue building
-
value
- Specified by:
valuein interfaceConditionalStatement.Value- Parameters:
value- The value of the statement- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for any errors in the set parameters -
build
Builds a newConditionalStatementusing the set parameters- Specified by:
buildin interfaceConditionalStatement.Build- Returns:
- The newly built
ConditionalStatement
-