package pw.ian.albkit.command.parser.parameter;

import java.util.Map;

/**
 * A wrapper around a HashMap to provide a set of parameters for commands
 *
 * @author Ollie
 */
public class Params {
    /**
     * A map of all of the parameters
     */
    private final Map<String, ParamChatSection> params;

    private boolean valid = true;

    /**
     * Creates a new set of Params from the given Map of parameters to values
     *
     * @param params The parameters and their values for this Params object
     */
    public Params(Map<String, ParamChatSection> params) {
        this.params = params;
    }

    /**
     * Gets a ParamChatSection value for the given parameter
     *
     * @param parameter The parameter to get the value for
     * @return A ParamChatSection for the given parameter
     */
    public ParamChatSection get(String parameter) {
        return params.get(parameter);
    }

    /**
     * Checks whether these Params contain a value for the given parameter
     *
     * @param parameter The parameter to check for the presence of
     * @return Whether the given parameter has a value in this Params object
     */
    public boolean has(String parameter) {
        return params.containsKey(parameter);
    }

    public boolean valid() {
        return valid;
    }

    void invalidate() {
        valid = false;
    }
}

@@ -59,19 +59,95 @@
 va.util.
-Map
+HashSet;%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0Aimport java.util.Set
 ;%0A%0A/**%0A 
@@ -376,16 +376,79 @@
 arams;%0A%0A
+    /**%0A     * Whether this set of parameters is valid%0A     */%0A
     priv
@@ -1390,61 +1390,1275 @@
     
-public boolean valid() %7B%0A        return valid;%0A    %7D%0A
+/**%0A     * Gets a Set of all of the parameter names contained by this Params%0A     * object's Map of parameters%0A     *%0A     * @return A Set of all of the parameter names for this Params%0A     */%0A    public Set%3CString%3E parameters() %7B%0A        return new HashSet%3C%3E(params.keySet());%0A    %7D%0A%0A    /**%0A     * Gets a Set of all of the parameter values contained by this Params%0A     * object's Map of parameters%0A     *%0A     * @return A Set of all of the parameter values for this Params%0A     */%0A    public Set%3CParamChatSection%3E values() %7B%0A        return new HashSet%3C%3E(params.values());%0A    %7D%0A%0A    /**%0A     * Gets a Set of all of the entries to the Map of parameters contained by%0A     * this Params object%0A     *%0A     * @return A Set of all entries to this Params' Map%0A     */%0A    public Set%3CEntry%3CString, ParamChatSection%3E%3E entries() %7B%0A        return new HashSet%3C%3E(params.entrySet());%0A    %7D%0A%0A    /**%0A     * Checks whether this set of parameters is valid for the base it was%0A     * constructed for. Used for automatic validation of arguments%0A     *%0A     * @return Whether this set of parameters is valid%0A     */%0A    public boolean valid() %7B%0A        return valid;%0A    %7D%0A%0A    /**%0A     * Invalidates this set of parameters. Should only be used in automatic%0A     * validation%0A     */
 %0A   

Add some more methods to Params