Class SimpleCommandContext
- java.lang.Object
-
- com.github.siroshun09.mccommand.common.context.SimpleCommandContext
-
- All Implemented Interfaces:
CommandContext
public class SimpleCommandContext extends Object implements CommandContext
TheCommandContext
implementation class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleCommandContext.SimpleCommandContextBuilder
Builder class ofCommandContext
.
-
Constructor Summary
Constructors Constructor Description SimpleCommandContext(@NotNull Command command, @NotNull Sender sender, @NotNull List<Argument> arguments, @NotNull String label)
Creates aSimpleCommandContext
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
@NotNull List<Argument>
getArguments()
Gets the given arguments.@NotNull Command
getCommand()
Gets the executed command.@NotNull String
getLabel()
Gets the string used to specify the command.@NotNull Sender
getSender()
Gets the commander.int
hashCode()
static @NotNull SimpleCommandContext.SimpleCommandContextBuilder
newBuilder()
Gets the newSimpleCommandContext.SimpleCommandContextBuilder
String
toString()
-
-
-
Constructor Detail
-
SimpleCommandContext
public SimpleCommandContext(@NotNull @NotNull Command command, @NotNull @NotNull Sender sender, @NotNull @NotNull List<Argument> arguments, @NotNull @NotNull String label)
Creates aSimpleCommandContext
- Parameters:
command
- the executed commandsender
- the commanderarguments
- the given argumentslabel
- the string used to specify the command
-
-
Method Detail
-
newBuilder
@NotNull public static @NotNull SimpleCommandContext.SimpleCommandContextBuilder newBuilder()
Gets the newSimpleCommandContext.SimpleCommandContextBuilder
- Returns:
- the new
SimpleCommandContext.SimpleCommandContextBuilder
-
getCommand
@NotNull public @NotNull Command getCommand()
Gets the executed command.- Specified by:
getCommand
in interfaceCommandContext
- Returns:
- the executed command
-
getSender
@NotNull public @NotNull Sender getSender()
Gets the commander.- Specified by:
getSender
in interfaceCommandContext
- Returns:
- the commander
-
getArguments
@NotNull public @NotNull List<Argument> getArguments()
Gets the given arguments.- Specified by:
getArguments
in interfaceCommandContext
- Returns:
- the given arguments
-
getLabel
@NotNull public @NotNull String getLabel()
Gets the string used to specify the command.It may always return the same string as
Command.getName()
.- Specified by:
getLabel
in interfaceCommandContext
- Returns:
- the string used to specify the command
-
-