Class ArgumentRange<T>
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<T>
net.minestom.server.command.builder.arguments.minecraft.ArgumentRange<T>
- Type Parameters:
T
- the type of the range
- Direct Known Subclasses:
ArgumentFloatRange
,ArgumentIntRange
public abstract class ArgumentRange<T> extends Argument<T>
Abstract class used by
ArgumentIntRange
and ArgumentFloatRange
.-
Field Summary
Fields Modifier and Type Field Description static int
FORMAT_ERROR
Fields inherited from class net.minestom.server.command.builder.arguments.Argument
SUCCESS, UNDEFINED_ERROR
-
Constructor Summary
Constructors Constructor Description ArgumentRange(java.lang.String id)
-
Method Summary
Modifier and Type Method Description int
getConditionResult(T value)
Called afterArgument.parse(String)
meaning thatvalue
should already represent a valid representation of the input.Methods inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, getCallback, getCorrectionResult, getId, hasErrorCallback, parse, setCallback, useRemaining
-
Field Details
-
FORMAT_ERROR
public static final int FORMAT_ERROR- See Also:
- Constant Field Values
-
-
Constructor Details
-
ArgumentRange
public ArgumentRange(java.lang.String id)
-
-
Method Details
-
getConditionResult
Description copied from class:Argument
Called afterArgument.parse(String)
meaning thatvalue
should already represent a valid representation of the input.The condition result has for goal to check the optional conditions that are user configurable (eg min/max values for a number, a specific material for an item, etc...).
- Specified by:
getConditionResult
in classArgument<T>
- Parameters:
value
- The parsed argument- Returns:
- the error code or
Argument.SUCCESS
-