com.mysema.query
Class BooleanBuilder

java.lang.Object
  extended by com.mysema.query.BooleanBuilder
All Implemented Interfaces:
Expression<Boolean>, Operation<Boolean>, Predicate, Serializable, Cloneable

public final class BooleanBuilder
extends Object
implements Predicate, Cloneable, Operation<Boolean>

BooleanBuilder is a cascading builder for Predicate expressions.

Author:
tiwe
See Also:
Serialized Form

Constructor Summary
BooleanBuilder()
           
BooleanBuilder(Predicate initial)
           
 
Method Summary
<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(Object o)
           
 Expression<?> getArg(int index)
          Get the argument with the given index
 List<Expression<?>> getArgs()
          Get the arguments of this operation
 Operator<? super Boolean> getOperator()
          Get the operator symbol for this operation
 Class<? extends 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
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanBuilder

public BooleanBuilder()

BooleanBuilder

public BooleanBuilder(Predicate initial)
Method Detail

accept

public <R,C> R accept(Visitor<R,C> v,
                      C context)
Description copied from interface: Expression
Accept the visitor with the given context

Specified by:
accept in interface Expression<Boolean>
Type Parameters:
R - return type
C - context type
Parameters:
v - visitor
context - context of visit
Returns:

and

public BooleanBuilder and(@Nullable
                          Predicate right)
Create the insertion of this and the given predicate

Parameters:
right -
Returns:

andAnyOf

public BooleanBuilder andAnyOf(Predicate... args)
Create the intersection of this and the union of the given args

(this && (arg1 || arg2 ... || argN))

Parameters:
args -
Returns:

andNot

public BooleanBuilder andNot(Predicate right)
Create the insertion of this and the negation of the given predicate

Parameters:
right -
Returns:

clone

public BooleanBuilder clone()
                     throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getArg

public Expression<?> getArg(int index)
Description copied from interface: Operation
Get the argument with the given index

Specified by:
getArg in interface Operation<Boolean>
Returns:

getArgs

public List<Expression<?>> getArgs()
Description copied from interface: Operation
Get the arguments of this operation

Specified by:
getArgs in interface Operation<Boolean>
Returns:

getOperator

public Operator<? super Boolean> getOperator()
Description copied from interface: Operation
Get the operator symbol for this operation

Specified by:
getOperator in interface Operation<Boolean>
Returns:

getValue

@Nullable
public Predicate getValue()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hasValue

public boolean hasValue()
Returns true if the value is set, and false, if not

Returns:

not

public BooleanBuilder not()
Description copied from interface: Predicate
Get the negation of the expression

Specified by:
not in interface Predicate
Returns:

or

public BooleanBuilder or(@Nullable
                         Predicate right)
Create the union of this and the given predicate

Parameters:
right -
Returns:

orAllOf

public BooleanBuilder orAllOf(Predicate... args)
Create the union of this and the intersection of the given args

(this || (arg1 && arg2 ... && argN))

Parameters:
args -
Returns:

orNot

public BooleanBuilder orNot(Predicate right)
Create the union of this and the negation of the given predicate

Parameters:
right -
Returns:

getType

public Class<? extends Boolean> getType()
Description copied from interface: Expression
Get the java type for this expression

Specified by:
getType in interface Expression<Boolean>
Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.