Package net.apartium.cocoabeans.commands
Record Class CommandContext
java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.CommandContext
- Record Components:
sender- The sender of the commandoption- The command option that was evaluatedargs- commands raw argscommandName- command nameparsedArgs- parsed args
public record CommandContext(Sender sender, CommandInfo commandInfo, @Nullable net.apartium.cocoabeans.commands.CommandOption option, @Nullable BadCommandResponse error, String[] args, String commandName, Map<Class<?>,List<Object>> parsedArgs)
extends Record
Represents the context of a command after it has been processed
-
Constructor Summary
ConstructorsConstructorDescriptionCommandContext(Sender sender, CommandInfo commandInfo, @Nullable net.apartium.cocoabeans.commands.CommandOption option, @Nullable BadCommandResponse error, String[] args, String commandName, Map<Class<?>, List<Object>> parsedArgs) Creates an instance of aCommandContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]args()Returns the value of theargsrecord component.Returns the value of thecommandInforecord component.Returns the value of thecommandNamerecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable BadCommandResponseerror()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.@Nullable net.apartium.cocoabeans.commands.CommandOptionoption()Returns the value of theoptionrecord component.Returns the value of theparsedArgsrecord component.sender()Returns the value of thesenderrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
CommandContext
public CommandContext(Sender sender, CommandInfo commandInfo, @Nullable @Nullable net.apartium.cocoabeans.commands.CommandOption option, @Nullable @Nullable BadCommandResponse error, String[] args, String commandName, Map<Class<?>, List<Object>> parsedArgs) Creates an instance of aCommandContextrecord class.- Parameters:
sender- the value for thesenderrecord componentcommandInfo- the value for thecommandInforecord componentoption- the value for theoptionrecord componenterror- the value for theerrorrecord componentargs- the value for theargsrecord componentcommandName- the value for thecommandNamerecord componentparsedArgs- the value for theparsedArgsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
sender
Returns the value of thesenderrecord component.- Returns:
- the value of the
senderrecord component
-
commandInfo
Returns the value of thecommandInforecord component.- Returns:
- the value of the
commandInforecord component
-
option
@Nullable public @Nullable net.apartium.cocoabeans.commands.CommandOption option()Returns the value of theoptionrecord component.- Returns:
- the value of the
optionrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
args
Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-
commandName
Returns the value of thecommandNamerecord component.- Returns:
- the value of the
commandNamerecord component
-
parsedArgs
Returns the value of theparsedArgsrecord component.- Returns:
- the value of the
parsedArgsrecord component
-