Class ObjectPredicateBuilder<T>
- java.lang.Object
-
- org.solidcoding.validation.predicates.ObjectPredicateBuilder<T>
-
- All Implemented Interfaces:
Predicate<T>,GenericPredicate<T>
public final class ObjectPredicateBuilder<T> extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> GenericPredicate<T>isA(Class<T> clazz)static <T> GenericPredicate<T>isAn(Class<T> clazz)static <T> Predicate<T>isNotNull()Checks whether the actual value is present.booleantest(T value)Predicate<T>where(Predicate<T> rule)
-
-
-
Method Detail
-
isNotNull
public static <T> Predicate<T> isNotNull()
Checks whether the actual value is present.- Type Parameters:
T- the type upon which the validations are tested.- Returns:
- Predicate to continue adding rules.
-
isA
public static <T> GenericPredicate<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:
- ObjectPredicate to continue adding rules.
-
isAn
public static <T> GenericPredicate<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:
- ObjectPredicate to continue adding rules.
-
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.
-
-