diff options
author | Luck <git@lucko.me> | 2022-06-28 21:13:07 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-06-28 21:13:07 +0100 |
commit | e5fc5ab0ac0016b8f4018f7f88d4603098d022c6 (patch) | |
tree | 344032a2ed779148ba1a2b49631c29c75557a154 /spark-common/src/main | |
parent | 3b93798a312a0b63b7d80a6b9a7ae3150f8fdaca (diff) | |
download | spark-e5fc5ab0ac0016b8f4018f7f88d4603098d022c6.tar.gz spark-e5fc5ab0ac0016b8f4018f7f88d4603098d022c6.tar.bz2 spark-e5fc5ab0ac0016b8f4018f7f88d4603098d022c6.zip |
Maintain order of exported config files
Diffstat (limited to 'spark-common/src/main')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java index 1fc2391..c66305f 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java +++ b/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/ServerConfigProvider.java @@ -23,8 +23,8 @@ package me.lucko.spark.common.platform.serverconfig; import com.google.gson.JsonElement; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Function to export server configuration files for access within the spark viewer. @@ -43,12 +43,9 @@ public interface ServerConfigProvider { Map<String, JsonElement> loadServerConfigurations(); default Map<String, String> exportServerConfigurations() { - return loadServerConfigurations().entrySet() - .stream() - .collect(Collectors.toMap( - Map.Entry::getKey, - e -> e.getValue().toString() - )); + Map<String, String> map = new LinkedHashMap<>(); + loadServerConfigurations().forEach((key, value) -> map.put(key, value.toString())); + return map; } /** |