Class DecimalNumberPredicateBuilder
- java.lang.Object
-
- org.solidcoding.validation.predicates.DecimalNumberPredicateBuilder
-
- All Implemented Interfaces:
Predicate<Double>,DecimalNumberPredicate,GenericPredicate<Double>
public final class DecimalNumberPredicateBuilder extends Object implements DecimalNumberPredicate
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChainingPredicate<Double,Predicate<Double>>between(double first)static DecimalNumberPredicatecontains(Integer value, Integer... values)Checks whether the given Integers are present anywhere in the value.static DecimalNumberPredicatedoesNotContain(Integer value, Integer... values)Checks whether the given Integers are not present anywhere in the value.static DecimalNumberPredicateis()static DecimalNumberPredicateis(double value)static DecimalNumberPredicateis(Predicate<Double> rule)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 DecimalNumberPredicate is()
- Returns:
- DoublePredicate to continue adding rules.
-
is
public static DecimalNumberPredicate is(double value)
- Parameters:
value- the exact expected value.- Returns:
- Predicate to continue adding rules.
-
is
public static DecimalNumberPredicate is(Predicate<Double> rule)
- Parameters:
rule- the custom predicate to test against the Double.- Returns:
- Predicate to continue adding rules.
-
contains
public static DecimalNumberPredicate 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:
- DecimalNumberPredicate to continue adding rules.
-
doesNotContain
public static DecimalNumberPredicate 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:
- DecimalNumberPredicate to continue adding rules.
-
between
public ChainingPredicate<Double,Predicate<Double>> between(double first)
- Specified by:
betweenin interfaceDecimalNumberPredicate- Parameters:
first- the first (inclusive) constraint. Can be either the high constraint or the low constraint.- Returns:
- a ChainingPredicate to add the second constraint.
-
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.
-
-