Class NumberPredicateBuilder

    • Method Detail

      • is

        public static org.solidcoding.validation.predicates.NumberPredicate is()
        Returns:
        IntegerPredicate to continue adding rules.
      • is

        public static Predicate<Integer> is​(int value)
        Parameters:
        value - the exact expected value.
        Returns:
        IntegerPredicate to continue adding rules.
      • hasAmountOfDigits

        public static Predicate<Integer> hasAmountOfDigits​(int amountOfDigits)
        Parameters:
        amountOfDigits - the exact amount of digits of the Integer.
        Returns:
        IntegerPredicate to continue adding rules.
      • contains

        public static Predicate<Integer> contains​(Integer value,
                                                  Integer... values)
        Checks whether the given Integers are present anywhere in the value.
        Parameters:
        value - the exact value that needs to be present in the toString of the original value.
        values - the optional exact values that needs to be present in the toString of the original value.
        Returns:
        NumberPredicate to continue adding rules.
      • doesNotContain

        public static Predicate<Integer> doesNotContain​(Integer value,
                                                        Integer... values)
        Checks whether the given Integers are not present anywhere in the value.
        Parameters:
        value - the exact value that may not be present in the toString of the original value.
        values - the optional exact values that may not be present in the toString of the original value.
        Returns:
        NumberPredicate to continue adding rules.
      • test

        public boolean test​(T value)
        Specified by:
        test in interface Predicate<T>
      • where

        public Predicate<T> where​(Predicate<T> rule)
        Specified by:
        where in interface GenericPredicate<T>
        Parameters:
        rule - the custom predicate to test against properties of T.
        Returns:
        ObjectPredicate to continue adding rules.