- private final Map<String, Option<Integer>> integerOptions = new HashMap<String, Option<Integer>>();
+ private final Map<String, Option<Integer>> integerOptions = Collections.synchronizedMap(new HashMap<String, Option<Integer>>());
+
+ /** Holds all {@link String} {@link Option}s. */
+ private final Map<String, Option<String>> stringOptions = Collections.synchronizedMap(new HashMap<String, Option<String>>());
+
+ /**
+ * Adds a boolean option.
+ *
+ * @param name
+ * The name of the option
+ * @param booleanOption
+ * The option
+ * @return The given option
+ */
+ public Option<Boolean> addBooleanOption(String name, Option<Boolean> booleanOption) {
+ booleanOptions.put(name, booleanOption);
+ return booleanOption;
+ }
+
+ /**
+ * Returns the boolean option with the given name.
+ *
+ * @param name
+ * The name of the option
+ * @return The option, or {@code null} if there is no option with the given
+ * name
+ */
+ public Option<Boolean> getBooleanOption(String name) {
+ return booleanOptions.get(name);
+ }