small cleanup
This commit is contained in:
@@ -12,13 +12,13 @@ public abstract class Datastore {
|
||||
protected final LuckPermsPlugin plugin;
|
||||
|
||||
@Getter
|
||||
public String name;
|
||||
public final String name;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean acceptingLogins;
|
||||
|
||||
public Datastore(LuckPermsPlugin plugin, String name) {
|
||||
protected Datastore(LuckPermsPlugin plugin, String name) {
|
||||
this.plugin = plugin;
|
||||
this.name = name;
|
||||
this.acceptingLogins = true;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MySQLDatastore extends SQLDatastore {
|
||||
private static final String CREATETABLE_USERS = "CREATE TABLE IF NOT EXISTS `lp_users` (`uuid` VARCHAR(36) NOT NULL, `name` VARCHAR(16) NOT NULL, `perms` TEXT NOT NULL, PRIMARY KEY (`uuid`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
|
||||
private static final String CREATETABLE_GROUPS = "CREATE TABLE IF NOT EXISTS `lp_groups` (`name` VARCHAR(36) NOT NULL, `perms` TEXT NULL, PRIMARY KEY (`name`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
|
||||
|
||||
private MySQLConfiguration configuration;
|
||||
private final MySQLConfiguration configuration;
|
||||
private HikariDataSource hikari;
|
||||
|
||||
public MySQLDatastore(LuckPermsPlugin plugin, MySQLConfiguration configuration) {
|
||||
|
||||
@@ -39,9 +39,9 @@ public abstract class SQLDatastore extends Datastore {
|
||||
private static final String UUIDCACHE_SELECT = "SELECT uuid FROM lp_uuid WHERE name=?";
|
||||
private static final String UUIDCACHE_UPDATE = "UPDATE lp_uuid SET uuid=? WHERE name=?";
|
||||
|
||||
private Gson gson;
|
||||
private final Gson gson;
|
||||
|
||||
public SQLDatastore(LuckPermsPlugin plugin, String name) {
|
||||
SQLDatastore(LuckPermsPlugin plugin, String name) {
|
||||
super(plugin, name);
|
||||
gson = new Gson();
|
||||
}
|
||||
@@ -317,7 +317,7 @@ public abstract class SQLDatastore extends Datastore {
|
||||
}
|
||||
|
||||
private class Closer {
|
||||
private List<AutoCloseable> objects = new ArrayList<>();
|
||||
private final List<AutoCloseable> objects = new ArrayList<>();
|
||||
|
||||
public void add(AutoCloseable a) {
|
||||
objects.add(a);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class SQLiteDatastore extends SQLDatastore {
|
||||
private static final String CREATETABLE_USERS = "CREATE TABLE IF NOT EXISTS `lp_users` (`uuid` VARCHAR(36) NOT NULL, `name` VARCHAR(16) NOT NULL, `perms` TEXT NOT NULL, PRIMARY KEY (`uuid`));";
|
||||
private static final String CREATETABLE_GROUPS = "CREATE TABLE IF NOT EXISTS `lp_groups` (`name` VARCHAR(36) NOT NULL, `perms` TEXT NULL, PRIMARY KEY (`name`));";
|
||||
|
||||
private File file;
|
||||
private final File file;
|
||||
private Connection connection = null;
|
||||
|
||||
public SQLiteDatastore(LuckPermsPlugin plugin, File file) {
|
||||
|
||||
Reference in New Issue
Block a user