Class NumberPredicateBuilder
- java.lang.Object
-
- org.solidcoding.validation.predicates.NumberPredicateBuilder
-
- All Implemented Interfaces:
Predicate<Integer>,GenericPredicate<Integer>
public final class NumberPredicateBuilder extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChainingPredicate<Integer,Predicate<Integer>>between(int first)static Predicate<Integer>contains(Integer value, Integer... values)Checks whether the given Integers are present anywhere in the value.static Predicate<Integer>doesNotContain(Integer value, Integer... values)Checks whether the given Integers are not present anywhere in the value.static Predicate<Integer>hasAmountOfDigits(int amountOfDigits)static org.solidcoding.validation.predicates.NumberPredicateis()static Predicate<Integer>is(int value)booleantest(T value)Predicate<T>where(Predicate<T> rule)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.solidcoding.validation.predicates.GenericPredicate
where
-
-
-
-
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.
-
between
public ChainingPredicate<Integer,Predicate<Integer>> between(int first)
-
where
public Predicate<T> where(Predicate<T> rule)
- Specified by:
wherein interfaceGenericPredicate<T>- Parameters:
rule- the custom predicate to test against properties of T.- Returns:
- ObjectPredicate to continue adding rules.
-
-