public final class BooleanBuilder extends java.lang.Object implements Predicate, java.lang.Cloneable
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)); }
Constructor and Description |
---|
BooleanBuilder()
Create an empty BooleanBuilder
|
BooleanBuilder(Predicate initial)
Create a BooleanBuilder with the given initial value
|
Modifier and Type | Method and Description |
---|---|
<R,C> R |
accept(Visitor<R,C> v,
C context)
Accept the visitor with the given context
|
BooleanBuilder |
and(Predicate right)
Create the insertion of this and the given predicate
|
BooleanBuilder |
andAnyOf(Predicate... args)
Create the intersection of this and the union of the given args
|
BooleanBuilder |
andNot(Predicate right)
Create the insertion of this and the negation of the given predicate
|
BooleanBuilder |
clone() |
boolean |
equals(java.lang.Object o) |
java.lang.Class<? extends java.lang.Boolean> |
getType()
Get the java type for this expression
|
Predicate |
getValue() |
int |
hashCode() |
boolean |
hasValue()
Returns true if the value is set, and false, if not
|
BooleanBuilder |
not()
Get the negation of the expression
|
BooleanBuilder |
or(Predicate right)
Create the union of this and the given predicate
|
BooleanBuilder |
orAllOf(Predicate... args)
Create the union of this and the intersection of the given args
|
BooleanBuilder |
orNot(Predicate right)
Create the union of this and the negation of the given predicate
|
java.lang.String |
toString() |
public BooleanBuilder()
public BooleanBuilder(Predicate initial)
initial
- public <R,C> R accept(Visitor<R,C> v, C context)
Expression
accept
in interface Expression<java.lang.Boolean>
R
- return typeC
- context typev
- visitorcontext
- context of visitpublic BooleanBuilder and(@Nullable Predicate right)
right
- public BooleanBuilder andAnyOf(Predicate... args)
(this && (arg1 || arg2 ... || argN))
args
- public BooleanBuilder andNot(Predicate right)
right
- public BooleanBuilder clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
@Nullable public Predicate getValue()
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasValue()
public BooleanBuilder not()
Predicate
public BooleanBuilder or(@Nullable Predicate right)
right
- public BooleanBuilder orAllOf(Predicate... args)
(this || (arg1 && arg2 ... && argN))
args
- public BooleanBuilder orNot(Predicate right)
right
- public java.lang.Class<? extends java.lang.Boolean> getType()
Expression
getType
in interface Expression<java.lang.Boolean>
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007-2013 Mysema Ltd. All Rights Reserved.