com.mysema.query
Class BooleanBuilder

java.lang.Object
  extended by com.mysema.query.types.ExpressionBase<D>
      extended by com.mysema.query.types.expr.SimpleExpression<D>
          extended by com.mysema.query.types.expr.ComparableExpressionBase<D>
              extended by com.mysema.query.types.expr.ComparableExpression<Boolean>
                  extended by com.mysema.query.types.expr.BooleanExpression
                      extended by com.mysema.query.BooleanBuilder
All Implemented Interfaces:
Expression<Boolean>, Operation<Boolean>, Predicate, Serializable, Cloneable

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

BooleanBuilder is a cascading builder for BooleanExpression expressions.

Author:
tiwe
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mysema.query.types.expr.SimpleExpression
primitive
 
Fields inherited from class com.mysema.query.types.ExpressionBase
type
 
Constructor Summary
BooleanBuilder()
           
BooleanBuilder(BooleanExpression initial)
           
 
Method Summary
<R,C> R
accept(Visitor<R,C> v, C context)
          Accept the visitor with the given context
 BooleanBuilder and(Predicate right)
          Get an intersection of this and the given expression
 BooleanBuilder andAnyOf(Predicate... args)
          Create the intersection of this and the union of the given args
 BooleanBuilder andNot(Predicate right)
           
 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
 Predicate getValue()
           
 int hashCode()
           
 boolean hasValue()
          Returns true if the value is set, and false, if not
 BooleanBuilder not()
          Get a negation of this boolean expression
 BooleanBuilder or(Predicate right)
          Get a union of this and the given expression
 BooleanBuilder orAllOf(Predicate... args)
          Create the union of this and the intersection of the given args
 BooleanBuilder orNot(Predicate right)
           
 
Methods inherited from class com.mysema.query.types.expr.BooleanExpression
allOf, anyOf, as, as
 
Methods inherited from class com.mysema.query.types.expr.ComparableExpression
between, between, goe, goe, gt, gt, loe, loe, lt, lt, notBetween, notBetween
 
Methods inherited from class com.mysema.query.types.expr.ComparableExpressionBase
asc, castToNum, desc, stringValue
 
Methods inherited from class com.mysema.query.types.expr.SimpleExpression
count, countDistinct, eq, eq, in, in, in, isNotNull, isNull, ne, ne, notIn, notIn, notIn, when, when
 
Methods inherited from class com.mysema.query.types.ExpressionBase
getType, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.types.Expression
getType
 

Constructor Detail

BooleanBuilder

public BooleanBuilder()

BooleanBuilder

public BooleanBuilder(BooleanExpression 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>
Returns:

and

public BooleanBuilder and(@Nullable
                          Predicate right)
Description copied from class: BooleanExpression
Get an intersection of this and the given expression

Overrides:
and in class BooleanExpression
Parameters:
right - right hand side of the union
Returns:
this && right

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)

clone

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

equals

public boolean equals(Object o)
Specified by:
equals in class SimpleExpression<Boolean>

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 SimpleExpression<Boolean>

hasValue

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

Returns:

not

public BooleanBuilder not()
Description copied from class: BooleanExpression
Get a negation of this boolean expression

Specified by:
not in interface Predicate
Overrides:
not in class BooleanExpression
Returns:
!this

or

public BooleanBuilder or(@Nullable
                         Predicate right)
Description copied from class: BooleanExpression
Get a union of this and the given expression

Overrides:
or in class BooleanExpression
Parameters:
right - right hand side of the union
Returns:
this || right

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)


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