public static class CommandEvent.Command extends Object
Is used to parse a message which seems to be a command.
| Modifier and Type | Method | Description |
|---|---|---|
String[] |
getArgs() |
Returns the arguments of the command.
|
List<String> |
getArgsAsList() |
Returns the command arguments not as an array, but as a List.
|
ICommand |
getExecutor() |
Returns the
ICommand instance that executed this command. |
String |
getJoinedArgs() |
Returns the arguments as a single String.
|
String |
getJoinedArgs(int fromIndex) |
Deprecated.
This method was deprecated and replaced by CommandEvent.Command#joinArgs.
|
String |
getLabel() |
Returns the label of the command.
|
String |
getRawArgs() |
Gets the unmodified arguments of this Command.
|
String |
getRawMessage() |
Returns the raw content of the event message.
|
String |
joinArgs(int fromIndex) |
Joins the command arguments from a specific index on.
|
String |
joinArgs(int fromIndex,
int toIndex) |
Joins the command arguments from and to a specific index.
|
String |
joinArgs(CharSequence delimiter,
int fromIndex,
int toIndex) |
Joins the command arguments with a specific delimiter from and to a specific index.
|
public String getLabel()
public String[] getArgs()
public ICommand getExecutor()
ICommand instance that executed this command.public String getRawMessage()
public String getRawArgs()
public List<String> getArgsAsList()
public String getJoinedArgs()
@Deprecated public String getJoinedArgs(int fromIndex)
fromIndex - from which argument index the Strings will be joined.IllegalArgumentException - if the given index is invalid (higher than the argument length or lower than 0.public String joinArgs(int fromIndex)
fromIndex - a start index which may not be out of bounds.IllegalArgumentException - if a parameter does not apply to the requirements.public String joinArgs(int fromIndex, int toIndex)
fromIndex - a start index which may not be out of bounds.toIndex - an end index which may not be smaller than fromIndex nor out of bounds.IllegalArgumentException - if a parameter does not apply to the requirements.public String joinArgs(@Nonnull CharSequence delimiter, int fromIndex, int toIndex)
delimiter - the delimiter that is supposed to join the arguments.fromIndex - a start index which may not be out of bounds.toIndex - an end index which may not be smaller than fromIndex nor out of bounds.IllegalArgumentException - if a parameter does not apply to the requirements.Copyright © 2018. All rights reserved.