Class DecimalNumberPredicate
- java.lang.Object
-
- org.solidcoding.validation.predicates.ObjectPredicate<Double>
-
- org.solidcoding.validation.predicates.DecimalNumberPredicate
-
- All Implemented Interfaces:
Predicate<Double>,PredicateAppender<Double>
public final class DecimalNumberPredicate extends ObjectPredicate<Double>
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Predicate<Double>contains(Integer value, Integer... values)Checks whether the given Integers are present anywhere in the value.static Predicate<Double>doesNotContain(Integer value, Integer... values)Checks whether the given Integers are not present anywhere in the value.static ConstraintAppender<Double,Predicate<Double>>isBetween(double first)static Predicate<Double>isEqualTo(double value)Check if the actual value is equal to the given one.static Predicate<Double>isNotNull()Checks whether the actual value is present.*-
Methods inherited from class org.solidcoding.validation.predicates.ObjectPredicate
isA, isAn, isEqualTo, test
-
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.PredicateAppender
that, that, where, where
-
-
-
-
Method Detail
-
isNotNull
public static Predicate<Double> isNotNull()
Checks whether the actual value is present.*- Returns:
- Predicate to continue adding rules.
-
isBetween
public static ConstraintAppender<Double,Predicate<Double>> isBetween(double first)
- Parameters:
first- the first (inclusive) constraint. Can be either the high constraint or the low constraint.- Returns:
- a ChainingPredicate to add the second constraint.
-
isEqualTo
public static Predicate<Double> isEqualTo(double value)
Check if the actual value is equal to the given one.- Parameters:
value- the exact expected value.- Returns:
- Predicate to continue adding rules.
-
contains
public static Predicate<Double> 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:
- Predicate to continue adding rules.
-
doesNotContain
public static Predicate<Double> 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:
- Predicate to continue adding rules.
-
-