summaryrefslogtreecommitdiffstats
path: root/libraries/launcher/org/multimc/ParamBucket.java
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2019-09-19 00:41:48 -0700
committerThomas Groman <tgroman@nuegia.net>2019-09-19 00:41:48 -0700
commit32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 (patch)
tree7be7a2f602e6a5af7bc2db86bef9cf2a659c3d3d /libraries/launcher/org/multimc/ParamBucket.java
parent5fb2c6334e7d5237db11695b4c0ec0f2d1e47c88 (diff)
downloadMultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar
MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.gz
MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.lz
MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.xz
MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.zip
merged from 0.6.7 codebase
Diffstat (limited to 'libraries/launcher/org/multimc/ParamBucket.java')
-rw-r--r--libraries/launcher/org/multimc/ParamBucket.java110
1 files changed, 55 insertions, 55 deletions
diff --git a/libraries/launcher/org/multimc/ParamBucket.java b/libraries/launcher/org/multimc/ParamBucket.java
index 5e9c3ff6..f5b40c40 100644
--- a/libraries/launcher/org/multimc/ParamBucket.java
+++ b/libraries/launcher/org/multimc/ParamBucket.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2018 MultiMC Contributors
+ * Copyright 2012-2019 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,65 +22,65 @@ import java.util.List;
public class ParamBucket
{
- public void add(String key, String value)
- {
- List<String> coll = null;
- if(!m_params.containsKey(key))
- {
- coll = new ArrayList<String>();
- m_params.put(key, coll);
- }
- else
- {
- coll = m_params.get(key);
- }
- coll.add(value);
- }
+ public void add(String key, String value)
+ {
+ List<String> coll = null;
+ if(!m_params.containsKey(key))
+ {
+ coll = new ArrayList<String>();
+ m_params.put(key, coll);
+ }
+ else
+ {
+ coll = m_params.get(key);
+ }
+ coll.add(value);
+ }
- public List<String> all(String key) throws NotFoundException
- {
- if(!m_params.containsKey(key))
- throw new NotFoundException();
- return m_params.get(key);
- }
+ public List<String> all(String key) throws NotFoundException
+ {
+ if(!m_params.containsKey(key))
+ throw new NotFoundException();
+ return m_params.get(key);
+ }
- public List<String> allSafe(String key, List<String> def)
- {
- if(!m_params.containsKey(key) || m_params.get(key).size() < 1)
- {
- return def;
- }
- return m_params.get(key);
- }
+ public List<String> allSafe(String key, List<String> def)
+ {
+ if(!m_params.containsKey(key) || m_params.get(key).size() < 1)
+ {
+ return def;
+ }
+ return m_params.get(key);
+ }
- public List<String> allSafe(String key)
- {
- return allSafe(key, new ArrayList<String>());
- }
+ public List<String> allSafe(String key)
+ {
+ return allSafe(key, new ArrayList<String>());
+ }
- public String first(String key) throws NotFoundException
- {
- List<String> list = all(key);
- if(list.size() < 1)
- {
- throw new NotFoundException();
- }
- return list.get(0);
- }
+ public String first(String key) throws NotFoundException
+ {
+ List<String> list = all(key);
+ if(list.size() < 1)
+ {
+ throw new NotFoundException();
+ }
+ return list.get(0);
+ }
- public String firstSafe(String key, String def)
- {
- if(!m_params.containsKey(key) || m_params.get(key).size() < 1)
- {
- return def;
- }
- return m_params.get(key).get(0);
- }
+ public String firstSafe(String key, String def)
+ {
+ if(!m_params.containsKey(key) || m_params.get(key).size() < 1)
+ {
+ return def;
+ }
+ return m_params.get(key).get(0);
+ }
- public String firstSafe(String key)
- {
- return firstSafe(key, "");
- }
+ public String firstSafe(String key)
+ {
+ return firstSafe(key, "");
+ }
- private HashMap<String, List<String>> m_params = new HashMap<String, List<String>>();
+ private HashMap<String, List<String>> m_params = new HashMap<String, List<String>>();
}