Cleaned up code
This commit is contained in:
parent
a207aca196
commit
e7b5a422de
@ -56,6 +56,7 @@ public class TableGenerator {
|
||||
|
||||
/**
|
||||
* Add a field to the table
|
||||
*
|
||||
* @param field The field you want to add
|
||||
* @return this class
|
||||
*/
|
||||
|
@ -9,7 +9,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
private final MySQLConnection connection;
|
||||
|
||||
private HashMap<String, Object> settingValues = new HashMap<>();
|
||||
private final HashMap<String, Object> settingValues = new HashMap<>();
|
||||
|
||||
public ConnectSettingsManager(MySQLConnection connection) {
|
||||
this.connection = connection;
|
||||
@ -17,6 +17,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Adds a custom property to the values
|
||||
*
|
||||
* @param property The property you want to add
|
||||
* @param value The value you want to use
|
||||
* @return this class
|
||||
@ -29,6 +30,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the timezone of the connection
|
||||
*
|
||||
* @param timezone The new timezone
|
||||
* @return this class
|
||||
*/
|
||||
@ -40,6 +42,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the requireSSL property
|
||||
*
|
||||
* @param requireSSL The new value of the requireSSL property
|
||||
* @return this class
|
||||
*/
|
||||
@ -50,6 +53,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the useSSL property
|
||||
*
|
||||
* @param useSSL The new value of the useSSL property
|
||||
* @return this class
|
||||
*/
|
||||
@ -60,6 +64,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the autoReconnect property
|
||||
*
|
||||
* @param autoReconnect The new value of the autoReconnect property
|
||||
* @return this class
|
||||
*/
|
||||
@ -70,6 +75,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the maxReconnects property
|
||||
*
|
||||
* @param maxReconnects The new value of the maxReconnects property
|
||||
* @return this class
|
||||
*/
|
||||
@ -80,6 +86,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the charset property
|
||||
*
|
||||
* @param charset The new value of the charset property
|
||||
* @return this class
|
||||
*/
|
||||
@ -90,6 +97,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the tcpKeepAlive property
|
||||
*
|
||||
* @param tcpKeepAlive The new value of the tcpKeepAlive property
|
||||
* @return this class
|
||||
*/
|
||||
@ -100,6 +108,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the tcpNoDelay property
|
||||
*
|
||||
* @param tcpNoDelay The new value of the tcpNoDelay property
|
||||
* @return this class
|
||||
*/
|
||||
@ -110,6 +119,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the tcpRcvBuf property
|
||||
*
|
||||
* @param tcpRcvBuf The new value of the tcpRcvBuf property
|
||||
* @return this class
|
||||
*/
|
||||
@ -120,6 +130,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the tcpSndBuf property
|
||||
*
|
||||
* @param tcpSndBuf The new value of the tcpSndBuf property
|
||||
* @return this class
|
||||
*/
|
||||
@ -130,6 +141,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the tcpTrafficClass property
|
||||
*
|
||||
* @param tcpTrafficClass The new value of the tcpTrafficClass property
|
||||
* @return this class
|
||||
*/
|
||||
@ -140,6 +152,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the useCompression property
|
||||
*
|
||||
* @param useCompression The new value of the useCompression property
|
||||
* @return this class
|
||||
*/
|
||||
@ -150,6 +163,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the useUnbufferedInput property
|
||||
*
|
||||
* @param useUnbufferedInput The new value of the useUnbufferedInput property
|
||||
* @return this class
|
||||
*/
|
||||
@ -160,6 +174,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Sets the paranoid property
|
||||
*
|
||||
* @param paranoid The new value of the paranoid property
|
||||
* @return this class
|
||||
*/
|
||||
@ -170,6 +185,7 @@ public class ConnectSettingsManager {
|
||||
|
||||
/**
|
||||
* Creates the connection string
|
||||
*
|
||||
* @return the connection string
|
||||
*/
|
||||
public String generateConnectionString() {
|
||||
|
@ -21,6 +21,7 @@ public class TableCreationQuery extends AbstractQuery {
|
||||
|
||||
/**
|
||||
* Builds the field list
|
||||
*
|
||||
* @return the field list as a string
|
||||
*/
|
||||
public String buildFieldList() {
|
||||
@ -33,7 +34,8 @@ public class TableCreationQuery extends AbstractQuery {
|
||||
builder.append(fieldList.get(i).generateSQLRow());
|
||||
}
|
||||
|
||||
if (!((String) getParameter(PRIMARY_KEY)).isEmpty()) builder.appendDefault(String.format(", PRIMARY KEY (%s)", getParameter(PRIMARY_KEY)));
|
||||
if (!((String) getParameter(PRIMARY_KEY)).isEmpty())
|
||||
builder.appendDefault(String.format(", PRIMARY KEY (%s)", getParameter(PRIMARY_KEY)));
|
||||
|
||||
return builder.append(")").build();
|
||||
}
|
||||
|
@ -127,6 +127,7 @@ public class TableField {
|
||||
|
||||
/**
|
||||
* Sets the extras of the field
|
||||
*
|
||||
* @param extras The extras you want to add
|
||||
* @return this class
|
||||
*/
|
||||
|
Reference in New Issue
Block a user