Class NotSpecification<T>
- java.lang.Object
-
- org.seedstack.business.specification.NotSpecification<T>
-
- Type Parameters:
T- the type of the candidate object the specification applies to.
- All Implemented Interfaces:
Specification<T>
public class NotSpecification<T> extends Object implements Specification<T>
A specification negating another specification.
-
-
Constructor Summary
Constructors Constructor Description NotSpecification(Specification<T> specification)Creates a specification negating the specification passed as argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Specification<T>getSpecification()Returns the specification that negated.booleanisSatisfiedBy(T candidate)Evaluates if the candidate object passed as argument satisfies the specification.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.seedstack.business.specification.Specification
and, asPredicate, negate, or
-
-
-
-
Constructor Detail
-
NotSpecification
public NotSpecification(Specification<T> specification)
Creates a specification negating the specification passed as argument.- Parameters:
specification- the specification to negate.
-
-
Method Detail
-
isSatisfiedBy
public boolean isSatisfiedBy(T candidate)
Description copied from interface:SpecificationEvaluates if the candidate object passed as argument satisfies the specification.- Specified by:
isSatisfiedByin interfaceSpecification<T>- Parameters:
candidate- the candidate object to check.- Returns:
- true if the candidate object satisfies the specification, false otherwise.
-
getSpecification
public Specification<T> getSpecification()
Returns the specification that negated.- Returns:
- the negated specification.
-
-