Class NumberConstraint
java.lang.Object
redempt.redlib.commandmanager.processing.NumberConstraint
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Number & Comparable<T>>
Constraint<T>getConstraint
(String str, Function<String, T> parse) Create a number constraint from a constraint string formatted like min,max or ,max or min,
-
Constructor Details
-
NumberConstraint
public NumberConstraint()
-
-
Method Details
-
getConstraint
public static <T extends Number & Comparable<T>> Constraint<T> getConstraint(String str, Function<String, T> parse) Create a number constraint from a constraint string formatted like min,max or ,max or min,- Type Parameters:
T
- The numeric type- Parameters:
str
- The constraint stringparse
- A function to parse a number of the given type from a string- Returns:
- A constraint which can check the range of a number of the given type
-