diff options
author | snowleo <schneeleo@gmail.com> | 2011-10-23 21:45:01 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-10-23 21:45:01 +0200 |
commit | 78884719823fb73d268bf9767189e85e7f916e41 (patch) | |
tree | 10e43a0d82d2db3b9c70d2ea3ee167db30682ad9 /EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java | |
parent | 1b4b78d6e63ec54a5fceb604dffd1311b83bef8b (diff) | |
download | Essentials-78884719823fb73d268bf9767189e85e7f916e41.tar Essentials-78884719823fb73d268bf9767189e85e7f916e41.tar.gz Essentials-78884719823fb73d268bf9767189e85e7f916e41.tar.lz Essentials-78884719823fb73d268bf9767189e85e7f916e41.tar.xz Essentials-78884719823fb73d268bf9767189e85e7f916e41.zip |
Statemachine for installation wizard (WIP)
Diffstat (limited to 'EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java')
-rw-r--r-- | EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java index 9cd1e5edb..c34e40ae5 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java @@ -1,9 +1,10 @@ package com.earth2me.essentials.update; -import java.util.ArrayList; import org.bukkit.configuration.Configuration; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class VersionInfo @@ -11,18 +12,18 @@ public class VersionInfo private final transient List<String> changelog; private final transient int minBukkit; private final transient int maxBukkit; - private final transient List<ModuleInfo> modules; + private final transient Map<String, ModuleInfo> modules; public VersionInfo(final Configuration updateConfig, final String path) { changelog = updateConfig.getList(path + ".changelog", Collections.<String>emptyList()); minBukkit = updateConfig.getInt(path + ".min-bukkit", 0); maxBukkit = updateConfig.getInt(path + ".max-bukkit", 0); - modules = new ArrayList<ModuleInfo>(); + modules = new HashMap<String, ModuleInfo>(); final String modulesPath = path + ".modules"; for (String module : updateConfig.getKeys(false)) { - modules.add(new ModuleInfo(updateConfig, modulesPath + module)); + modules.put(module, new ModuleInfo(updateConfig, modulesPath + module)); } } @@ -41,8 +42,8 @@ public class VersionInfo return maxBukkit; } - public List<ModuleInfo> getModules() + public Map<String, ModuleInfo> getModules() { - return Collections.unmodifiableList(modules); + return Collections.unmodifiableMap(modules); } } |