Package com.querydsl.core
Class BooleanBuilder
java.lang.Object
com.querydsl.core.BooleanBuilder
- All Implemented Interfaces:
Expression<Boolean>,Predicate,Serializable,Cloneable
BooleanBuilder is a cascading builder for Predicate expressions.
BooleanBuilder is a mutable Expression implementation.
Usage example:
QEmployee employee = QEmployee.employee;
BooleanBuilder builder = new BooleanBuilder();
for (String name : names) {
builder.or(employee.name.equalsIgnoreCase(name));
}
- Author:
- tiwe
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty BooleanBuilderBooleanBuilder(Predicate initial) Create a BooleanBuilder with the given initial value -
Method Summary
Modifier and TypeMethodDescription<R,C> R Accept the visitor with the given contextCreate the intersection of this and the given predicateCreate the intersection of this and the union of the given args(this && (arg1 || arg2 ... || argN))Create the insertion of this and the negation of the given predicateclone()booleangetType()Get the java type for this expression@Nullable PredicategetValue()inthashCode()booleanhasValue()Returns true if the value is set, and false, if notnot()Get the negation of the expressionCreate the union of this and the given predicateCreate the union of this and the intersection of the given args(this || (arg1 && arg2 ... && argN))Create the union of this and the negation of the given predicatetoString()
-
Constructor Details
-
BooleanBuilder
public BooleanBuilder()Create an empty BooleanBuilder -
BooleanBuilder
Create a BooleanBuilder with the given initial value- Parameters:
initial- initial value
-
-
Method Details
-
accept
Description copied from interface:ExpressionAccept the visitor with the given context- Specified by:
acceptin interfaceExpression<Boolean>- Type Parameters:
R- return typeC- context type- Parameters:
v- visitorcontext- context of visit- Returns:
- result of visit
-
and
Create the intersection of this and the given predicate- Parameters:
right- right hand side ofandoperation- Returns:
- the current object
-
andAnyOf
Create the intersection of this and the union of the given args(this && (arg1 || arg2 ... || argN))- Parameters:
args- union of predicates- Returns:
- the current object
-
andNot
Create the insertion of this and the negation of the given predicate- Parameters:
right- predicate to be negated- Returns:
- the current object
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
equals
-
getValue
-
hashCode
public int hashCode() -
hasValue
public boolean hasValue()Returns true if the value is set, and false, if not- Returns:
- true if initialized and false if not
-
not
Description copied from interface:PredicateGet the negation of the expression -
or
Create the union of this and the given predicate- Parameters:
right- right hand side oforoperation- Returns:
- the current object
-
orAllOf
Create the union of this and the intersection of the given args(this || (arg1 && arg2 ... && argN))- Parameters:
args- intersection of predicates- Returns:
- the current object
-
orNot
Create the union of this and the negation of the given predicate- Parameters:
right- predicate to be negated- Returns:
- the current object
-
getType
Description copied from interface:ExpressionGet the java type for this expression- Specified by:
getTypein interfaceExpression<Boolean>- Returns:
- type of expression
-
toString
-