Added ServerConfiguration#toHashMap

This commit is contained in:
Mathias Wagner 2024-02-13 22:25:04 +01:00
parent 15b2b4177e
commit 743066f959
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -7,6 +7,7 @@ import de.gnmyt.mcdash.api.Logger;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import java.io.File; import java.io.File;
import java.util.HashMap;
public class ServerConfiguration { public class ServerConfiguration {
@ -185,6 +186,21 @@ public class ServerConfiguration {
save(); save();
} }
/**
* Creates a new server configuration
* @return The created server configuration
*/
public HashMap<String, Object> toHashMap() {
HashMap<String, Object> map = new HashMap<>();
map.put("name", name);
map.put("type", type);
map.put("version", version);
map.put("description", description);
map.put("memory", memory);
map.put("autoStart", autoStart);
return map;
}
@Override @Override
public String toString() { public String toString() {
return "ServerConfiguration{" + return "ServerConfiguration{" +