Class CompoundPredicate

  • All Implemented Interfaces:
    Expression, Predicate

    public class CompoundPredicate
    extends AbstractPredicate
    An conjunction or disjunction of multiple predicates.
    Since:
    1.0.0
    Author:
    Christian Beikov
    • Constructor Detail

      • CompoundPredicate

        public CompoundPredicate​(com.blazebit.domain.runtime.model.DomainType type,
                                 List<Predicate> predicates,
                                 boolean conjunction)
        Creates a new compound predicate from the given predicates as conjunction or disjunction returning a result of the given domain type.
        Parameters:
        type - The result domain type
        predicates - The predicates
        conjunction - true for conjunction, false for disjunction
      • CompoundPredicate

        public CompoundPredicate​(com.blazebit.domain.runtime.model.DomainType type,
                                 List<Predicate> predicates,
                                 boolean conjunction,
                                 boolean negated)
        Creates a new possibly negated compound predicate from the given predicates as conjunction or disjunction returning a result of the given domain type.
        Parameters:
        type - The result domain type
        predicates - The predicates
        conjunction - true for conjunction, false for disjunction
        negated - true if the predicate should be negated, false otherwise
    • Method Detail

      • isConjunction

        public boolean isConjunction()
        Returns true if this is a conjunction, false otherwise.
        Returns:
        true if this is a conjunction, false otherwise
      • getPredicates

        public List<Predicate> getPredicates()
        Returns the predicates that are part of this compound predicate.
        Returns:
        the predicates that are part of this compound predicate
      • accept

        public void accept​(Expression.Visitor visitor)
        Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.
        Parameters:
        visitor - The visitor to call visit on
      • accept

        public <T> T accept​(Expression.ResultVisitor<T> visitor)
        Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.
        Type Parameters:
        T - The result type
        Parameters:
        visitor - The visitor to call visit on
        Returns:
        the value as returned by the result visitor