From: David ‘Bombe’ Roden Date: Mon, 25 Oct 2010 06:21:11 +0000 (+0200) Subject: Add boolean options. X-Git-Tag: 0.1-RC1~34 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=365991b0251eec67549e34a70d0b8bdd130de8f4;p=Sone.git Add boolean options. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Options.java b/src/main/java/net/pterodactylus/sone/core/Options.java index 752c36c..cbe88c8 100644 --- a/src/main/java/net/pterodactylus/sone/core/Options.java +++ b/src/main/java/net/pterodactylus/sone/core/Options.java @@ -154,10 +154,39 @@ public class Options { } + /** Holds all {@link Boolean} {@link Option}s. */ + private final Map> booleanOptions = new HashMap>(); + /** Holds all {@link Integer} {@link Option}s. */ private final Map> integerOptions = new HashMap>(); /** + * Adds a boolean option. + * + * @param name + * The name of the option + * @param booleanOption + * The option + * @return The given option + */ + public Option addBooleanOption(String name, Option 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 getBooleanOption(String name) { + return booleanOptions.get(name); + } + + /** * Adds an {@link Integer} {@link Option}. * * @param name