Class ArgumentIntRange
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<T>
net.minestom.server.command.builder.arguments.minecraft.ArgumentRange<IntRange>
net.minestom.server.command.builder.arguments.minecraft.ArgumentIntRange
public class ArgumentIntRange extends ArgumentRange<IntRange>
Represents an argument which will give you an
IntRange
.
Example: ..3, 3.., 5..10, 15
-
Field Summary
Fields inherited from class net.minestom.server.command.builder.arguments.minecraft.ArgumentRange
FORMAT_ERROR
Fields inherited from class net.minestom.server.command.builder.arguments.Argument
SUCCESS, UNDEFINED_ERROR
-
Constructor Summary
Constructors Constructor Description ArgumentIntRange(java.lang.String id)
-
Method Summary
Modifier and Type Method Description int
getCorrectionResult(java.lang.String value)
First method called to check the validity of an input.IntRange
parse(java.lang.String value)
Called afterArgument.getCorrectionResult(String)
returnedArgument.SUCCESS
.Methods inherited from class net.minestom.server.command.builder.arguments.minecraft.ArgumentRange
getConditionResult
Methods inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, getCallback, getId, hasErrorCallback, setCallback, useRemaining
-
Constructor Details
-
ArgumentIntRange
public ArgumentIntRange(java.lang.String id)
-
-
Method Details
-
getCorrectionResult
public int getCorrectionResult(@NotNull java.lang.String value)Description copied from class:Argument
First method called to check the validity of an input.If
Argument.allowSpace()
is enabled, the value will be incremented by the next word until it returnsArgument.SUCCESS
, meaning that you need to be sure to check the inexpensive operations first (eg the number of brackets, the first and last char, etc...).- Specified by:
getCorrectionResult
in classArgument<IntRange>
- Parameters:
value
- The received argument- Returns:
- the error code or
Argument.SUCCESS
-
parse
Description copied from class:Argument
Called afterArgument.getCorrectionResult(String)
returnedArgument.SUCCESS
.The correction being correct means that
value
shouldn't be verified again, you can assume that no exception will occur when converting it to the correct type.
-