Class 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 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: Specification
        Evaluates if the candidate object passed as argument satisfies the specification.
        Specified by:
        isSatisfiedBy in interface Specification<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.