Class OrSpecification<T>
- java.lang.Object
-
- org.seedstack.business.specification.OrSpecification<T>
-
- Type Parameters:
T- the type of the candidate object the specification applies to.
- All Implemented Interfaces:
Specification<T>
public class OrSpecification<T> extends Object implements Specification<T>
A specification composing multiple specifications with a logical OR.
-
-
Constructor Summary
Constructors Constructor Description OrSpecification(Specification<? super T>... specifications)Creates a specification composing the specifications passed as argument with a logical OR.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Specification<? super T>[]getSpecifications()Returns the composed specifications.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
-
OrSpecification
@SafeVarargs public OrSpecification(Specification<? super T>... specifications)
Creates a specification composing the specifications passed as argument with a logical OR.- Parameters:
specifications- the specifications to compose in a logical OR.
-
-
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.
-
getSpecifications
public Specification<? super T>[] getSpecifications()
Returns the composed specifications.- Returns:
- the array specifications composed with the logical AND.
-
-