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
-
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to instantiate outside of SQLDropDatabaseStatement -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs a newSQLDropStatement
using the set parametersprivate void
Checks 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
Thetype
to 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:
table
in interfaceSQLDropStatement.Type
- Returns:
- this, to continue building
-
database
We'll be dropping a Database- Specified by:
database
in interfaceSQLDropStatement.Type
- Returns:
- this, to continue building
-
ifExists
Sets to include IF EXISTS in the statement- Specified by:
ifExists
in interfaceSQLDropStatement.ExistsOrName
- Returns:
- this, to continue building
-
name
- Specified by:
name
in 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 newSQLDropStatement
using the set parameters- Specified by:
build
in interfaceSQLDropStatement.Build
- Returns:
- The newly built
SQLDropStatement
-