summaryrefslogtreecommitdiffstats
path: root/EssentialsUpdate/src/f00f/net/irc/martyr/commands/AbstractCommand.java
blob: a3e3ef2c2c94c9713cf874a71316a6bd29f1abb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package f00f.net.irc.martyr.commands;

import f00f.net.irc.martyr.OutCommand;

/**
 * Defines a generic command.  Most commands will simply have to
 * override the getIrcIdentifier method and implement the parse and
 * render methods using convenience methods.
 */
public abstract class AbstractCommand extends AbstractInCommand implements OutCommand
{

    /**
     * Forms a string appropriate to send to the server.  All commands can
     * be sent by the client.
     */
    public String render()
    {
        // no prefix, since we are sending as a client.
        return getIrcIdentifier() + " " + renderParams();
    }

    /**
     * Renders the parameters of this command.
     *
     * @return String of rendered parameters
     */
    public abstract String renderParams();

}