Class ObjectPredicate<T>
- java.lang.Object
-
- org.solidcoding.validation.predicates.ObjectPredicate<T>
-
- All Implemented Interfaces:
Predicate<T>,PredicateAppender<T>
- Direct Known Subclasses:
DecimalNumberPredicate,NumberPredicate,StringPredicate
public class ObjectPredicate<T> extends Object implements Predicate<T>, PredicateAppender<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedObjectPredicate(Predicate<T> predicate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> PredicateAppender<T>isA(Class<T> clazz)static <T> PredicateAppender<T>isAn(Class<T> clazz)static <T> Predicate<T>isEqualTo(T value)Check if the actual value is equal to the given one.booleantest(T value)-
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
-
isA
public static <T> PredicateAppender<T> isA(Class<T> clazz)
- Type Parameters:
T- the type upon which the validations are tested.- Parameters:
clazz- the class of the object to validate. This is only a compiler flag to treat T as its instance.- Returns:
- GenericPredicateRule to continue adding rules.
-
isAn
public static <T> PredicateAppender<T> isAn(Class<T> clazz)
- Type Parameters:
T- the type upon which the validations are tested.- Parameters:
clazz- the class of the object to validate. This is only a compiler flag to treat T as its instance.- Returns:
- GenericPredicateRule to continue adding rules.
-
isEqualTo
public static <T> Predicate<T> isEqualTo(T value)
Check if the actual value is equal to the given one.- Type Parameters:
T- the value which you wish to test against the original value.- Parameters:
value- the exact expected value.- Returns:
- Predicate to continue adding rules.
-
-