Class ArgumentString
java.lang.Object
org.teleight.teleightbots.commands.builder.argument.Argument<String>
org.teleight.teleightbots.commands.builder.argument.ArgumentString
Class representing a string argument.
This class extends the Argument class with a type parameter of String. It overrides the parse method of the Argument class to return the input string as it is.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentString(String id) Constructs an ArgumentString with the specified identifier.ArgumentString(String id, boolean readRemaining) Constructs an ArgumentString with the specified identifier and a boolean indicating whether to read the remaining input or not. -
Method Summary
Modifier and TypeMethodDescriptionReturns the input string as it is.booleanReturns the value of the readRemaining field.
-
Constructor Details
-
ArgumentString
Constructs an ArgumentString with the specified identifier and a boolean indicating whether to read the remaining input or not.- Parameters:
id- the identifier of the argumentreadRemaining- a boolean indicating whether to read the remaining input or not
-
ArgumentString
Constructs an ArgumentString with the specified identifier. The readRemaining field is set to false by default.- Parameters:
id- the identifier of the argument
-
-
Method Details
-
parse
Returns the input string as it is.- Specified by:
parsein classArgument<String>- Parameters:
input- the input string to be parsed- Returns:
- the input string as it is
- Throws:
ArgumentSyntaxException- if the input string cannot be parsed
-
readRemaining
public boolean readRemaining()Returns the value of the readRemaining field.- Returns:
- the value of the readRemaining field
-