Class NumberConstraint

java.lang.Object
redempt.redlib.commandmanager.processing.NumberConstraint

public class NumberConstraint extends Object
  • 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 string
      parse - 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