public class MessageCommand extends Command<MessageCommand>
Command.Tags
Constructor and Description |
---|
MessageCommand(@NonNull Client client)
Constructs a message command.
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the command.
|
@NonNull MessageCommand |
message(@Nullable String message)
Sets the message to send.
|
@NonNull MessageCommand |
target(@NonNull MessageReceiver target) |
@NonNull MessageCommand |
target(@NonNull String target)
Sets the target of this message.
|
protected @NonNull ToStringer |
toStringer()
Generates a partial
ToStringer for the command. |
getClient, sendCommandLine, sendCommandLine, tags, toString
public MessageCommand(@NonNull Client client)
client
- the client on which this command is executingIllegalArgumentException
- if null parameterspublic @NonNull MessageCommand target(@NonNull String target)
target
- targetIllegalArgumentException
- if target is null or contains invalid characterspublic @NonNull MessageCommand target(@NonNull MessageReceiver target)
public @NonNull MessageCommand message(@Nullable String message)
message
- messageIllegalArgumentException
- if message contains invalid characterspublic void execute()
execute
in class Command<MessageCommand>
IllegalStateException
- if target or message is not definedprotected @NonNull ToStringer toStringer()
Command
ToStringer
for the command.toStringer
in class Command<MessageCommand>
Copyright © 2013–2021 Kitteh. All rights reserved.