Class SQLDropStatement.SQLDropStatementBuilder
java.lang.Object
com.github.tadukoo.database.mysql.syntax.statement.SQLDropStatement.SQLDropStatementBuilder
- All Implemented Interfaces:
SQLDropStatement.Build,SQLDropStatement.ExistsOrName,SQLDropStatement.Name,SQLDropStatement.Type
- Enclosing class:
- SQLDropStatement
public static class SQLDropStatement.SQLDropStatementBuilder
extends Object
implements SQLDropStatement.Type, SQLDropStatement.ExistsOrName, SQLDropStatement.Name, SQLDropStatement.Build
A builder to create a
SQLDropStatement. It takes the following parameters:
| Parameter | Description | Required or Default |
|---|---|---|
| type | The type to be dropped |
Required |
| ifExists | Whether to include IF EXISTS in the statement or not | Defaults to false |
| databaseName | The name of the table/database to be dropped | Required |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to instantiate outside of SQLDropDatabaseStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs a newSQLDropStatementusing the set parametersprivate voidChecks for any errors and throws an IllegalArgumentException if any errors are founddatabase()We'll be dropping a DatabaseifExists()Sets to include IF EXISTS in the statementtable()We'll be dropping a Table
-
Field Details
-
type
Thetypeto be dropped -
ifExists
private boolean ifExistsWhether to include IF EXISTS in the statement or not -
name
The name of the table/database to be dropped
-
-
Constructor Details
-
SQLDropStatementBuilder
private SQLDropStatementBuilder()Not allowed to instantiate outside of SQLDropDatabaseStatement
-
-
Method Details
-
table
We'll be dropping a Table- Specified by:
tablein interfaceSQLDropStatement.Type- Returns:
- this, to continue building
-
database
We'll be dropping a Database- Specified by:
databasein interfaceSQLDropStatement.Type- Returns:
- this, to continue building
-
ifExists
Sets to include IF EXISTS in the statement- Specified by:
ifExistsin interfaceSQLDropStatement.ExistsOrName- Returns:
- this, to continue building
-
name
- Specified by:
namein interfaceSQLDropStatement.Name- Parameters:
name- The name of the table/database to be dropped- Returns:
- this, to continue building
-
checkForErrors
private void checkForErrors()Checks for any errors and throws an IllegalArgumentException if any errors are found -
build
Constructs a newSQLDropStatementusing the set parameters- Specified by:
buildin interfaceSQLDropStatement.Build- Returns:
- The newly built
SQLDropStatement
-