From 365991b0251eec67549e34a70d0b8bdd130de8f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 25 Oct 2010 08:21:11 +0200 Subject: [PATCH] Add boolean options. --- .../java/net/pterodactylus/sone/core/Options.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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 -- 2.7.4