Class NumberPredicate

  • All Implemented Interfaces:
    ArgumentPredicate<java.lang.Long>

    public class NumberPredicate
    extends java.lang.Object
    implements ArgumentPredicate<java.lang.Long>
    An ArgumentPredicate that can be used on arguments with Long input type
    It validates the input with an inclusive range
    • Constructor Detail

      • NumberPredicate

        public NumberPredicate​(long min,
                               long max)
    • Method Detail

      • getPredicate

        public java.util.function.Predicate<java.lang.Long> getPredicate()
        Specified by:
        getPredicate in interface ArgumentPredicate<java.lang.Long>
      • lessThan

        public static NumberPredicate lessThan​(long min)
        Constructs the validation with only a minimum
        Parameters:
        min - the minimum
        Returns:
        the NumberPredicate
      • greaterThan

        public static NumberPredicate greaterThan​(long max)
        Constructs the validation with only a maximum
        Parameters:
        max - the maximum
        Returns:
        the NumberPredicate
      • notInRage

        public static NumberPredicate notInRage​(long min,
                                                long max)
        Constructs the validation with a range
        Parameters:
        min - the minimum
        max - the maximum
        Returns:
        the NumberPredicate