Refactoring SQL config class names again

This commit is contained in:
nossr50
2019-03-13 07:10:57 -07:00
parent a8bf6357aa
commit 1c289cfcdf
28 changed files with 47 additions and 44 deletions

View File

@ -11,13 +11,16 @@ public class ConfigDatabase {
*/
@Setting(value = "MySQL", comment = "Settings for using MySQL or MariaDB database")
private UserConfigSectionMySQL userConfigSectionMySQL = new UserConfigSectionMySQL();
private ConfigSectionMySQL configSectionMySQL = new ConfigSectionMySQL();
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
private boolean enabled = true;
/*
* GETTER BOILERPLATE
*/
public UserConfigSectionMySQL getUserConfigSectionMySQL() {
return userConfigSectionMySQL;
public ConfigSectionMySQL getConfigSectionMySQL() {
return configSectionMySQL;
}
}

View File

@ -4,7 +4,7 @@ import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class UserConfigSectionDatabase {
public class ConfigSectionDatabase {
@Setting(value = "Database_Name", comment = "The database name for your DB, this DB must already exist on the SQL server.")
private String databaseName = "example_database_name";

View File

@ -4,15 +4,15 @@ import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class UserConfigSectionMaxConnections {
public class ConfigSectionMaxConnections {
@Setting(value = "Misc")
@Setting(value = "Misc_Connection_Limit")
private int misc = 30;
@Setting(value = "Load")
@Setting(value = "Load_Connection_Limit")
private int load = 30;
@Setting(value = "Save")
@Setting(value = "Save_Connection_Limit")
private int save = 30;
/*

View File

@ -4,14 +4,14 @@ import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class UserConfigSectionMaxPoolSize {
@Setting(value = "Misc")
public class ConfigSectionMaxPoolSize {
@Setting(value = "Misc_Pool")
private int misc = 10;
@Setting(value = "Load")
@Setting(value = "Load_Pool")
private int load = 20;
@Setting(value = "Save")
@Setting(value = "Save_Pool")
private int save = 20;
/*

View File

@ -5,16 +5,16 @@ import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class UserConfigSectionMySQL {
public class ConfigSectionMySQL {
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
private boolean enabled = true;
@Setting(value = "User", comment = "Your MySQL User Settings")
private UserConfigSectionUser userConfigSectionUser = new UserConfigSectionUser();
private ConfigSectionUser configSectionUser = new ConfigSectionUser();
@Setting(value = "Database", comment = "Database settings for MySQL/MariaDB")
private UserConfigSectionDatabase userConfigSectionDatabase = new UserConfigSectionDatabase();
private ConfigSectionDatabase configSectionDatabase = new ConfigSectionDatabase();
@Setting(value = "Server", comment = "Your MySQL/MariaDB server settings.")
private UserConfigSectionServer userConfigSectionServer = new UserConfigSectionServer();
@ -27,12 +27,12 @@ public class UserConfigSectionMySQL {
return enabled;
}
public UserConfigSectionUser getUserConfigSectionUser() {
return userConfigSectionUser;
public ConfigSectionUser getConfigSectionUser() {
return configSectionUser;
}
public UserConfigSectionDatabase getUserConfigSectionDatabase() {
return userConfigSectionDatabase;
public ConfigSectionDatabase getConfigSectionDatabase() {
return configSectionDatabase;
}
public UserConfigSectionServer getUserConfigSectionServer() {
@ -44,11 +44,11 @@ public class UserConfigSectionMySQL {
switch (poolIdentifier)
{
case LOAD:
return userConfigSectionServer.getUserConfigSectionMaxPoolSize().getLoad();
return userConfigSectionServer.getConfigSectionMaxPoolSize().getLoad();
case SAVE:
return userConfigSectionServer.getUserConfigSectionMaxPoolSize().getSave();
return userConfigSectionServer.getConfigSectionMaxPoolSize().getSave();
case MISC:
return userConfigSectionServer.getUserConfigSectionMaxPoolSize().getMisc();
return userConfigSectionServer.getConfigSectionMaxPoolSize().getMisc();
default:
return 20;
}
@ -59,11 +59,11 @@ public class UserConfigSectionMySQL {
switch (poolIdentifier)
{
case LOAD:
return userConfigSectionServer.getUserConfigSectionMaxConnections().getLoad();
return userConfigSectionServer.getConfigSectionMaxConnections().getLoad();
case SAVE:
return userConfigSectionServer.getUserConfigSectionMaxConnections().getSave();
return userConfigSectionServer.getConfigSectionMaxConnections().getSave();
case MISC:
return userConfigSectionServer.getUserConfigSectionMaxConnections().getMisc();
return userConfigSectionServer.getConfigSectionMaxConnections().getMisc();
default:
return 20;
}

View File

@ -4,7 +4,7 @@ import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class UserConfigSectionUser {
public class ConfigSectionUser {
@Setting(value = "User_Name", comment = "The authorized user for your MySQL/MariaDB DB")
private String username = "example_user_name";

View File

@ -21,10 +21,10 @@ public class UserConfigSectionServer {
@Setting(value = "Max_Connections", comment = "This setting is the max simultaneous MySQL/MariaDB connections allowed at a time." +
"\nThis needs to be high enough to support multiple player logins in quick succession, it is recommended that you do not lower these values")
private UserConfigSectionMaxConnections userConfigSectionMaxConnections = new UserConfigSectionMaxConnections();
private ConfigSectionMaxConnections configSectionMaxConnections = new ConfigSectionMaxConnections();
@Setting(value = "Max_Pool_Size", comment = "This setting is the max size of the pool of cached connections that we hold at any given time.")
private UserConfigSectionMaxPoolSize userConfigSectionMaxPoolSize = new UserConfigSectionMaxPoolSize();
private ConfigSectionMaxPoolSize configSectionMaxPoolSize = new ConfigSectionMaxPoolSize();
/*
* GETTER BOILERPLATE
@ -42,12 +42,12 @@ public class UserConfigSectionServer {
return serverAddress;
}
public UserConfigSectionMaxConnections getUserConfigSectionMaxConnections() {
return userConfigSectionMaxConnections;
public ConfigSectionMaxConnections getConfigSectionMaxConnections() {
return configSectionMaxConnections;
}
public UserConfigSectionMaxPoolSize getUserConfigSectionMaxPoolSize() {
return userConfigSectionMaxPoolSize;
public ConfigSectionMaxPoolSize getConfigSectionMaxPoolSize() {
return configSectionMaxPoolSize;
}