Made SettingsTable into a static information class:

- Made constructor private
- Removed getter in SQLDB
This commit is contained in:
Rsl1122 2019-02-14 18:08:07 +02:00
parent 59040df981
commit b9164d7eff
3 changed files with 4 additions and 14 deletions

View File

@ -79,7 +79,6 @@ public abstract class SQLDB extends AbstractDatabase {
private final SessionsTable sessionsTable; private final SessionsTable sessionsTable;
private final TPSTable tpsTable; private final TPSTable tpsTable;
private final ServerTable serverTable; private final ServerTable serverTable;
private final SettingsTable settingsTable;
private final SQLFetchOps fetchOps; private final SQLFetchOps fetchOps;
private final SQLSearchOps searchOps; private final SQLSearchOps searchOps;
@ -112,7 +111,6 @@ public abstract class SQLDB extends AbstractDatabase {
usersTable = new UsersTable(this); usersTable = new UsersTable(this);
userInfoTable = new UserInfoTable(this); userInfoTable = new UserInfoTable(this);
sessionsTable = new SessionsTable(this); sessionsTable = new SessionsTable(this);
settingsTable = new SettingsTable(this);
fetchOps = new SQLFetchOps(this); fetchOps = new SQLFetchOps(this);
searchOps = new SQLSearchOps(this); searchOps = new SQLSearchOps(this);
@ -361,11 +359,6 @@ public abstract class SQLDB extends AbstractDatabase {
return userInfoTable; return userInfoTable;
} }
@Deprecated
public SettingsTable getSettingsTable() {
return settingsTable;
}
@Override @Override
@Deprecated @Deprecated
public FetchOperations fetch() { public FetchOperations fetch() {

View File

@ -17,16 +17,15 @@
package com.djrapitops.plan.db.sql.tables; package com.djrapitops.plan.db.sql.tables;
import com.djrapitops.plan.db.DBType; import com.djrapitops.plan.db.DBType;
import com.djrapitops.plan.db.SQLDB;
import com.djrapitops.plan.db.sql.parsing.CreateTableParser; import com.djrapitops.plan.db.sql.parsing.CreateTableParser;
import com.djrapitops.plan.db.sql.parsing.Sql; import com.djrapitops.plan.db.sql.parsing.Sql;
/** /**
* Table that represents plan_settings. * Table information about 'plan_settings'.
* *
* @author Rsl1122 * @author Rsl1122
*/ */
public class SettingsTable extends Table { public class SettingsTable {
public static final String TABLE_NAME = "plan_settings"; public static final String TABLE_NAME = "plan_settings";
@ -45,8 +44,8 @@ public class SettingsTable extends Table {
SERVER_UUID + "=? AND " + SERVER_UUID + "=? AND " +
CONFIG_CONTENT + "!=?"; CONFIG_CONTENT + "!=?";
public SettingsTable(SQLDB db) { private SettingsTable() {
super(TABLE_NAME, db); /* Static information class */
} }
public static String createTableSQL(DBType dbType) { public static String createTableSQL(DBType dbType) {

View File

@ -29,7 +29,6 @@ public class SQLOps {
protected final SessionsTable sessionsTable; protected final SessionsTable sessionsTable;
protected final TPSTable tpsTable; protected final TPSTable tpsTable;
protected final ServerTable serverTable; protected final ServerTable serverTable;
protected final SettingsTable settingsTable;
public SQLOps(SQLDB db) { public SQLOps(SQLDB db) {
this.db = db; this.db = db;
@ -39,6 +38,5 @@ public class SQLOps {
sessionsTable = db.getSessionsTable(); sessionsTable = db.getSessionsTable();
tpsTable = db.getTpsTable(); tpsTable = db.getTpsTable();
serverTable = db.getServerTable(); serverTable = db.getServerTable();
settingsTable = db.getSettingsTable();
} }
} }