X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FOptions.java;h=cbe88c8ecb12fc37b2bce37f38d6ed14099d3380;hb=b29cf0908e6dfd2b55220a3a7e44200f2fe5b19e;hp=752c36c403fdc3fad96219e57f553e249f93f7be;hpb=bc11c5c7ea2d08b5cc3acd62a0af06459997454c;p=Sone.git 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