From a86f1a7c7f87cbcb02888850e1a229b34a5e340a Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 14 Feb 2013 02:02:25 -0800 Subject: [PATCH] Add parameter list/remove. --- .../protocol/GuacamoleConfiguration.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java index 3474bd7cf..dca225261 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java @@ -38,8 +38,10 @@ package net.sourceforge.guacamole.protocol; * ***** END LICENSE BLOCK ***** */ import java.io.Serializable; +import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Set; /** * All information necessary to complete the initial protocol handshake of a @@ -90,4 +92,24 @@ public class GuacamoleConfiguration implements Serializable { parameters.put(name, value); } + /** + * Removes the value set for the parameter with the given name. + * + * @param name The name of the parameter to remove the value of. + */ + public void unsetParameter(String name) { + parameters.remove(name); + } + + /** + * Returns a set of all currently defined parameter names. Each name + * corresponds to a parameter that has a value set on this + * GuacamoleConfiguration via setParameter(). + * + * @return A set of all currently defined parameter names. + */ + public Set getParameterNames() { + return Collections.unmodifiableSet(parameters.keySet()); + } + }