/*
 * Copyright 2014 Matthew Collins
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package uk.co.thinkofdeath.command;

/**
 * Contains the information required to display a
 * error message
 */
public class CommandError {

    private final int priority;
    private final String key;
    private final Object[] args;

    public CommandError(int priority, String key, Object... args) {
        this.priority = priority;
        this.key = key;
        this.args = args;
    }

    /**
     * The priority of error, used in selecting which
     * error message to display
     *
     * @return The priority
     */
    public int getPriority() {
        return priority;
    }

    /**
     * The localization key for this error
     *
     * @return The key
     */
    public String getKey() {
        return key;
    }

    /**
     * Returns the number of additional arguments
     * to the message this error has
     *
     * @return The number of arguments
     */
    public int getArgumentCount() {
        return args.length;
    }

    /**
     * Returns the argument at the index.
     *
     * @param i
     *         The index of the argument
     * @return The argument
     * @throws java.lang.ArrayIndexOutOfBoundsException
     *         if the index is less than zero or greater
     *         than or equal {@link #getArgumentCount()}
     */
    public Object getArgument(int i) {
        return args[i];
    }
}

@@ -731,18 +731,36 @@
 ndError 
+extends LocaleKey 
 %7B%0A
-
 %0A    pri
@@ -788,38 +788,8 @@
 ty;%0A
-    private final String key;%0A
     
@@ -882,24 +882,44 @@
 ... args) %7B%0A
+        super(key);%0A
         this
@@ -944,32 +944,8 @@
 ty;%0A
-        this.key = key;%0A
     
@@ -1137,24 +1137,24 @@
 riority() %7B%0A
+
         retu
@@ -1177,153 +1177,8 @@
  %7D%0A%0A
-    /**%0A     * The localization key for this error%0A     *%0A     * @return The key%0A     */%0A    public String getKey() %7B%0A        return key;%0A    %7D%0A%0A
     

Modify CommandError to extend LocaleKey