Class DoubleArgument<C>
- java.lang.Object
-
- cloud.commandframework.arguments.CommandArgument<C,java.lang.Double>
-
- cloud.commandframework.arguments.standard.DoubleArgument<C>
-
- All Implemented Interfaces:
java.lang.Comparable<CommandArgument<?,?>>
public final class DoubleArgument<C> extends CommandArgument<C,java.lang.Double>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DoubleArgument.Builder<C>
static class
DoubleArgument.DoubleParseException
static class
DoubleArgument.DoubleParser<C>
-
Method Summary
Modifier and Type Method Description double
getMax()
Get the maximum accepted double that could have been parseddouble
getMin()
Get the minimum accepted double that could have been parsedstatic <C> @NonNull DoubleArgument.Builder<C>
newBuilder(@NonNull java.lang.String name)
Create a new builderstatic <C> @NonNull CommandArgument<C,java.lang.Double>
of(@NonNull java.lang.String name)
Create a new required command argumentstatic <C> @NonNull CommandArgument<C,java.lang.Double>
optional(@NonNull java.lang.String name)
Create a new optional command argumentstatic <C> @NonNull CommandArgument<C,java.lang.Double>
optional(@NonNull java.lang.String name, double defaultNum)
Create a new required command argument with a default value-
Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultValue, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
-
-
-
Method Detail
-
newBuilder
public static <C> @NonNull DoubleArgument.Builder<C> newBuilder(@NonNull java.lang.String name)
Create a new builder- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the argument- Returns:
- Created builder
-
of
public static <C> @NonNull CommandArgument<C,java.lang.Double> of(@NonNull java.lang.String name)
Create a new required command argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,java.lang.Double> optional(@NonNull java.lang.String name)
Create a new optional command argument- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument name- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,java.lang.Double> optional(@NonNull java.lang.String name, double defaultNum)
Create a new required command argument with a default value- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namedefaultNum
- Default num- Returns:
- Created argument
-
getMin
public double getMin()
Get the minimum accepted double that could have been parsed- Returns:
- Minimum double
-
getMax
public double getMax()
Get the maximum accepted double that could have been parsed- Returns:
- Maximum double
-
-