Package com.blazebit.expression
Class CompoundPredicate
- java.lang.Object
-
- com.blazebit.expression.AbstractExpression
-
- com.blazebit.expression.AbstractPredicate
-
- com.blazebit.expression.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.blazebit.expression.Expression
Expression.ResultVisitor<T>, Expression.Visitor
-
-
Constructor Summary
Constructors Constructor Description 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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(Expression.ResultVisitor<T> visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.void
accept(Expression.Visitor visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.boolean
equals(Object o)
List<Predicate>
getPredicates()
Returns the predicates that are part of this compound predicate.int
hashCode()
boolean
isConjunction()
Returnstrue
if this is a conjunction,false
otherwise.-
Methods inherited from class com.blazebit.expression.AbstractPredicate
isNegated, setNegated
-
Methods inherited from class com.blazebit.expression.AbstractExpression
getType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.blazebit.expression.Expression
getType, getUsedPaths
-
-
-
-
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 typepredicates
- The predicatesconjunction
-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 typepredicates
- The predicatesconjunction
-true
for conjunction,false
for disjunctionnegated
-true
if the predicate should be negated,false
otherwise
-
-
Method Detail
-
isConjunction
public boolean isConjunction()
Returnstrue
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
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractPredicate
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractPredicate
-
-