+ /**
+ * Adds a {@link String} {@link Option}.
+ *
+ * @param name
+ * The name of the option
+ * @param stringOption
+ * The option
+ * @return The given option
+ */
+ public Option<String> addStringOption(String name, Option<String> stringOption) {
+ stringOptions.put(name, stringOption);
+ return stringOption;
+ }
+
+ /**
+ * Returns a {@link String} {@link Option}.
+ *
+ * @param name
+ * The name of the string option to get
+ * @return The string option, or {@code null} if there is no option with the
+ * given name
+ */
+ public Option<String> getStringOption(String name) {
+ return stringOptions.get(name);
+ }
+
+ /**
+ * Adds an {@link Enum} {@link Option}.
+ *
+ * @param name
+ * The name of the option
+ * @param enumOption
+ * The option
+ * @return The given option
+ */
+ public <T extends Enum<T>> Option<T> addEnumOption(String name, Option<T> enumOption) {
+ enumOptions.put(name, enumOption);
+ return enumOption;
+ }
+
+ /**
+ * Returns a {@link Enum} {@link Option}. As the type can probably not be
+ * interred correctly you could help the compiler by calling this method
+ * like this:
+ * <p>
+ *
+ * <pre>
+ * options.<SomeEnum> getEnumOption("SomeEnumOption").get();
+ * </pre>
+ *
+ * @param name
+ * The name of the option
+ * @return The enum option, or {@code null} if there is no enum option with
+ * the given name
+ */
+ @SuppressWarnings("unchecked")
+ public <T extends Enum<T>> Option<T> getEnumOption(String name) {
+ return (Option<T>) enumOptions.get(name);
+ }
+