Interface Specification<T>

    • Method Detail

      • any

        static <T> Specification<T> any()
        Special value for an always true specification.
        Type Parameters:
        T - the type of the candidate object the specification applies to.
        Returns:
        a TrueSpecification.
      • none

        static <T> Specification<T> none()
        Special value for an always false specification.
        Type Parameters:
        T - the type of the candidate object the specification applies to.
        Returns:
        a FalseSpecification.
      • and

        default Specification<T> and​(Specification<? super T> other)
        Compose this specification with another specification through a logical AND.
        Parameters:
        other - the other specification.
        Returns:
        an AndSpecification composing this specification with the specification passed as argument.
      • or

        default Specification<T> or​(Specification<? super T> other)
        Compose this specification with another specification through a logical OR.
        Parameters:
        other - the other specification.
        Returns:
        an OrSpecification composing this specification with the specification passed as argument.
      • asPredicate

        default Predicate<T> asPredicate()
        Express this specification as a Java Predicate.
        Returns:
        the Predicate corresponding to this specification.
      • isSatisfiedBy

        boolean isSatisfiedBy​(T candidate)
        Evaluates if the candidate object passed as argument satisfies the specification.
        Parameters:
        candidate - the candidate object to check.
        Returns:
        true if the candidate object satisfies the specification, false otherwise.