GeoInfoTable now static info class:

- Made constructor private
- Removed getter from SQLDB
This commit is contained in:
Rsl1122 2019-01-31 21:06:33 +02:00
parent 0799674de3
commit b0170b76af
4 changed files with 3 additions and 15 deletions

View File

@ -75,7 +75,6 @@ public abstract class SQLDB extends AbstractDatabase {
private final KillsTable killsTable;
private final NicknamesTable nicknamesTable;
private final SessionsTable sessionsTable;
private final GeoInfoTable geoInfoTable;
private final TPSTable tpsTable;
private final SecurityTable securityTable;
private final WorldTimesTable worldTimesTable;
@ -116,7 +115,6 @@ public abstract class SQLDB extends AbstractDatabase {
usersTable = new UsersTable(this);
userInfoTable = new UserInfoTable(this);
geoInfoTable = new GeoInfoTable(this);
nicknamesTable = new NicknamesTable(this);
sessionsTable = new SessionsTable(this);
killsTable = new KillsTable(this);
@ -363,11 +361,6 @@ public abstract class SQLDB extends AbstractDatabase {
return killsTable;
}
@Deprecated
public GeoInfoTable getGeoInfoTable() {
return geoInfoTable;
}
@Deprecated
public NicknamesTable getNicknamesTable() {
return nicknamesTable;

View File

@ -17,7 +17,6 @@
package com.djrapitops.plan.db.sql.tables;
import com.djrapitops.plan.db.DBType;
import com.djrapitops.plan.db.SQLDB;
import com.djrapitops.plan.db.patches.*;
import com.djrapitops.plan.db.sql.parsing.CreateTableParser;
import com.djrapitops.plan.db.sql.parsing.Sql;
@ -36,7 +35,7 @@ import com.djrapitops.plan.db.sql.parsing.Sql;
*
* @author Rsl1122
*/
public class GeoInfoTable extends Table {
public class GeoInfoTable {
public static final String TABLE_NAME = "plan_ips";
@ -61,8 +60,8 @@ public class GeoInfoTable extends Table {
" AND " + IP_HASH + "=?" +
" AND " + GEOLOCATION + "=?";
public GeoInfoTable(SQLDB db) {
super(TABLE_NAME, db);
private GeoInfoTable() {
/* Static information class */
}
public static String createTableSQL(DBType dbType) {

View File

@ -29,7 +29,6 @@ public class SQLOps {
protected final KillsTable killsTable;
protected final NicknamesTable nicknamesTable;
protected final SessionsTable sessionsTable;
protected final GeoInfoTable geoInfoTable;
protected final TPSTable tpsTable;
protected final SecurityTable securityTable;
protected final WorldTimesTable worldTimesTable;
@ -45,7 +44,6 @@ public class SQLOps {
killsTable = db.getKillsTable();
nicknamesTable = db.getNicknamesTable();
sessionsTable = db.getSessionsTable();
geoInfoTable = db.getGeoInfoTable();
tpsTable = db.getTpsTable();
securityTable = db.getSecurityTable();
worldTimesTable = db.getWorldTimesTable();

View File

@ -498,7 +498,6 @@ public abstract class CommonDBTest {
UsersTable usersTable = db.getUsersTable();
SessionsTable sessionsTable = db.getSessionsTable();
NicknamesTable nicknamesTable = db.getNicknamesTable();
GeoInfoTable geoInfoTable = db.getGeoInfoTable();
usersTable.registerUser(playerUUID, 223456789L, "Test_name");
userInfoTable.registerUserInfo(playerUUID, 223456789L);
@ -551,7 +550,6 @@ public abstract class CommonDBTest {
UserInfoTable userInfoTable = db.getUserInfoTable();
UsersTable usersTable = db.getUsersTable();
NicknamesTable nicknamesTable = db.getNicknamesTable();
GeoInfoTable geoInfoTable = db.getGeoInfoTable();
TPSTable tpsTable = db.getTpsTable();
SecurityTable securityTable = db.getSecurityTable();
PingTable pingTable = db.getPingTable();