Contents
Class ParseResult
java.lang.Object
com.hypixel.hytale.server.core.command.system.ParseResult
This class assists in getting rid of using exceptions during command parsing
by providing a way to send errors up the chain of command.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for aParseResultinstance.ParseResult(boolean throwExceptionWhenFailed) Default Constructor for aParseResultinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled to fail this parse result, with a given reason.voidFail this ParseResult.booleanfailed()voidsendMessages(CommandSender sender) Send the messages to the command sender.
-
Constructor Details
-
ParseResult
public ParseResult()Empty Constructor for aParseResultinstance. -
ParseResult
public ParseResult(boolean throwExceptionWhenFailed) Default Constructor for aParseResultinstance.- Parameters:
throwExceptionWhenFailed- Whether to throw an exception if parsing fails.
-
-
Method Details
-
fail
-
fail
Called to fail this parse result, with a given reason.- Parameters:
reason- The reason for the failure.
-
failed
public boolean failed()- Returns:
trueif the parsing failed,falseotherwise.
-
sendMessages
Send the messages to the command sender.- Parameters:
sender- the sender to send the messages to.
-