[Debt] Removed some deprecated Settings methods.

Removed methods: toString(), getStringList() & set(Object).

Affected issues: none
This commit is contained in:
Rsl1122 2018-09-18 12:18:55 +03:00
parent f92c9e2b89
commit 275bfe64b4
2 changed files with 3 additions and 26 deletions

View File

@ -11,6 +11,7 @@ import com.djrapitops.plan.data.store.objects.DateHolder;
import com.djrapitops.plan.system.database.databases.Database;
import com.djrapitops.plan.system.info.server.ServerInfo;
import com.djrapitops.plan.system.settings.Settings;
import com.djrapitops.plan.system.settings.config.PlanConfig;
import com.djrapitops.plan.system.settings.theme.Theme;
import com.djrapitops.plan.system.settings.theme.ThemeVal;
import com.djrapitops.plan.utilities.MiscUtils;
@ -38,6 +39,7 @@ public class NetworkContainer extends DataContainer {
private final ServerContainer bungeeContainer;
// TODO
private PlanConfig config;
private Database database;
private Graphs graphs;
@ -91,7 +93,7 @@ public class NetworkContainer extends DataContainer {
putSupplier(NetworkKeys.NETWORK_NAME, () ->
Check.isBungeeAvailable() ?
Settings.BUNGEE_NETWORK_NAME.toString() :
config.getString(Settings.BUNGEE_NETWORK_NAME) :
bungeeContainer.getValue(ServerKeys.NAME).orElse("Plan")
);
putSupplier(NetworkKeys.PLAYERS_ONLINE, ServerInfo.getServerProperties_Old()::getOnlinePlayers);

View File

@ -5,8 +5,6 @@ import com.djrapitops.plan.system.settings.config.Setting;
import com.djrapitops.plugin.config.Config;
import com.djrapitops.plugin.utilities.Verify;
import java.util.List;
/**
* This enum contains all of the config settings used by the plugin for easier
* access.
@ -125,20 +123,6 @@ public enum Settings implements Setting {
return getConfig().getBoolean(configPath);
}
/**
* If the settings is a String, this method should be used.
*
* @return String value of the config setting.
*/
@Override
@Deprecated
public String toString() {
if (tempValue != null) {
return String.valueOf(tempValue);
}
return getConfig().getString(configPath);
}
/**
* If the settings is a number, this method should be used.
*
@ -152,10 +136,6 @@ public enum Settings implements Setting {
return getConfig().getInt(configPath);
}
public List<String> getStringList() {
return getConfig().getStringList(configPath);
}
/**
* Used to get the String path of a the config setting eg.
* Settings.WebServer.Enabled
@ -171,11 +151,6 @@ public enum Settings implements Setting {
this.tempValue = value;
}
@Deprecated
public void set(Object value) {
getConfig().set(getPath(), value);
}
private Config getConfig() {
Config config = ConfigSystem.getConfig_Old();
Verify.nullCheck(config, () -> new IllegalStateException("Settings are not supposed to be called before ConfigSystem is Enabled!"));