Package net.apartium.cocoabeans.commands
Record Class ArgumentContext
java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.ArgumentContext
- Record Components:
commandName- command nameargs- argssender- senderparsedArgs- parsed args
@AvailableSince("0.0.36")
public record ArgumentContext(String commandName, String[] args, Sender sender, Map<Class<?>,List<Object>> parsedArgs)
extends Record
Argument context is general context for all arguments
Used for all commands and other system like Flag system and compound parser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]args()Returns the value of theargsrecord component.Returns the value of thecommandNamerecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.Returns the value of theparsedArgsrecord component.sender()Returns the value of thesenderrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ArgumentContext
public ArgumentContext(String commandName, String[] args, Sender sender, Map<Class<?>, List<Object>> parsedArgs) Creates an instance of aArgumentContextrecord class.- Parameters:
commandName- the value for thecommandNamerecord componentargs- the value for theargsrecord componentsender- the value for thesenderrecord 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. -
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
commandName
Returns the value of thecommandNamerecord component.- Returns:
- the value of the
commandNamerecord component
-
args
Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-
sender
Returns the value of thesenderrecord component.- Returns:
- the value of the
senderrecord component
-
parsedArgs
Returns the value of theparsedArgsrecord component.- Returns:
- the value of the
parsedArgsrecord component
-