Package net.apartium.cocoabeans.commands
Class SimpleCommandProcessingContext
java.lang.Object
net.apartium.cocoabeans.commands.SimpleCommandProcessingContext
- All Implemented Interfaces:
CommandProcessingContext
@AvailableSince("0.0.37")
public class SimpleCommandProcessingContext
extends Object
implements CommandProcessingContext
A simple implementation of
CommandProcessingContext-
Constructor Summary
ConstructorsConstructorDescriptionSimpleCommandProcessingContext(@NotNull Sender sender, String label, String[] args, int index) Create a simple command processing context -
Method Summary
Modifier and TypeMethodDescriptionargs()Returns the argumentsvoidClear the current reportRetrieving the current reportintindex()Returns the current indexlabel()Returns the command namevoidreport(Object source, @NotNull BadCommandResponse response) report a problem with command parsing@NotNull Sendersender()Returns the sendersenderMeetsRequirement(Requirement requirement) check if sender meets requirement
-
Constructor Details
-
Method Details
-
sender
Returns the sender- Specified by:
senderin interfaceCommandProcessingContext- Returns:
- sender
-
label
Returns the command name- Specified by:
labelin interfaceCommandProcessingContext- Returns:
- command name
-
args
Returns the arguments- Specified by:
argsin interfaceCommandProcessingContext- Returns:
- arguments
-
index
public int index()Returns the current index- Specified by:
indexin interfaceCommandProcessingContext- Returns:
- current index
-
senderMeetsRequirement
check if sender meets requirement- Specified by:
senderMeetsRequirementin interfaceCommandProcessingContext- Parameters:
requirement- requirement to meet- Returns:
- requirement result
-
report
report a problem with command parsing- Specified by:
reportin interfaceCommandProcessingContext- Parameters:
source- source reporter of the problemresponse- response error description object
-
getReport
Retrieving the current report- Returns:
- current report
-
clearReports
public void clearReports()Clear the current report
-