Class NumberPredicate
- java.lang.Object
-
- org.solidcoding.validation.predicates.NumberPredicate
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NumberPredicatebeANumber()static NumberPredicatebeANumber(int value)static NumberPredicatebeANumber(Predicate<Integer> rule)static NumberPredicatebeANumberOfLength(int amountOfDigits)NumberConstraintPredicatebetween(int first)NumberPredicatecontaining(int integer, int... integers)Determines if the given integers are present or a part of the actual Integer.booleantest(Integer value)
-
-
-
Method Detail
-
beANumber
public static NumberPredicate beANumber()
- Returns:
- IntegerPredicate to continue adding rules.
-
beANumber
public static NumberPredicate beANumber(int value)
- Parameters:
value- the exact expected value.- Returns:
- IntegerPredicate to continue adding rules.
-
beANumber
public static NumberPredicate beANumber(Predicate<Integer> rule)
- Parameters:
rule- the custom predicate to test against the Integer.- Returns:
- IntegerPredicate to continue adding rules.
-
beANumberOfLength
public static NumberPredicate beANumberOfLength(int amountOfDigits)
- Parameters:
amountOfDigits- the exact amount of digits of the Integer.- Returns:
- IntegerPredicate to continue adding rules.
-
between
public NumberConstraintPredicate between(int first)
-
containing
public NumberPredicate containing(int integer, int... integers)
Determines if the given integers are present or a part of the actual Integer.- Parameters:
integer- the integer that needs to be present in the Integer.integers- the optional integers that need to be present in the Integer.- Returns:
- IntegerPredicate to continue adding rules.
-
-