public abstract class NumberRange<T extends Number> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
NumberRange.CommandFactory<T extends Number,R extends NumberRange<T>> |
static interface |
NumberRange.Factory<T extends Number,R extends NumberRange<T>> |
static class |
NumberRange.FloatRange |
static class |
NumberRange.IntRange |
Modifier and Type | Field and Description |
---|---|
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType |
EXCEPTION_EMPTY |
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType |
EXCEPTION_SWAPPED |
protected T |
max |
protected T |
min |
Modifier | Constructor and Description |
---|---|
protected |
NumberRange(T min,
T max) |
Modifier and Type | Method and Description |
---|---|
protected static <T extends Number,R extends NumberRange<T>> |
fromJson(JsonElement json,
R fallback,
BiFunction<JsonElement,String,T> asNumber,
NumberRange.Factory<T,R> factory) |
private static <T extends Number> |
fromStringReader(com.mojang.brigadier.StringReader reader,
Function<String,T> converter,
Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> exceptionTypeSupplier) |
T |
getMax() |
T |
getMin() |
boolean |
isDummy() |
private static boolean |
isNextCharValid(com.mojang.brigadier.StringReader reader) |
private static <T> T |
map(T object,
Function<T,T> function) |
protected static <T extends Number,R extends NumberRange<T>> |
parse(com.mojang.brigadier.StringReader commandReader,
NumberRange.CommandFactory<T,R> commandFactory,
Function<String,T> converter,
Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> exceptionTypeSupplier,
Function<T,T> mapper) |
JsonElement |
toJson() |
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType EXCEPTION_EMPTY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType EXCEPTION_SWAPPED
public boolean isDummy()
public JsonElement toJson()
protected static <T extends Number,R extends NumberRange<T>> R fromJson(@Nullable JsonElement json, R fallback, BiFunction<JsonElement,String,T> asNumber, NumberRange.Factory<T,R> factory)
protected static <T extends Number,R extends NumberRange<T>> R parse(com.mojang.brigadier.StringReader commandReader, NumberRange.CommandFactory<T,R> commandFactory, Function<String,T> converter, Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> exceptionTypeSupplier, Function<T,T> mapper)
@Nullable private static <T extends Number> T fromStringReader(com.mojang.brigadier.StringReader reader, Function<String,T> converter, Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> exceptionTypeSupplier)
private static boolean isNextCharValid(com.mojang.brigadier.StringReader reader)