com.mysema.query.types.expr
Class CaseForEqBuilder<D>

java.lang.Object
  extended by com.mysema.query.types.expr.CaseForEqBuilder<D>
Type Parameters:
D -

public final class CaseForEqBuilder<D>
extends Object

CaseForEqBuilder enables the construction of typesafe case-when-then-else constructs for equals-operations : e.g.

 QCustomer c = QCustomer.customer;
 Expression<Integer> cases = c.annualSpending
     .when(1000l).then(1)
     .when(2000l).then(2)
     .when(5000l).then(3)
     .otherwise(4);
 

Author:
tiwe

Nested Class Summary
 class CaseForEqBuilder.Cases<T,Q extends Expression<T>>
           
 class CaseForEqBuilder.CaseWhen<T,Q extends Expression<T>>
           
 
Constructor Summary
CaseForEqBuilder(Expression<D> base, Expression<? extends D> other)
           
 
Method Summary
<T> CaseForEqBuilder.Cases<T,Expression<T>>
then(Expression<T> then)
           
<T extends Number & Comparable<?>>
CaseForEqBuilder.Cases<T,NumberExpression<T>>
then(NumberExpression<T> then)
           
 CaseForEqBuilder.Cases<String,StringExpression> then(String then)
           
 CaseForEqBuilder.Cases<String,StringExpression> then(StringExpression then)
           
<T> CaseForEqBuilder.Cases<T,Expression<T>>
then(T then)
           
<T extends Number & Comparable<?>>
CaseForEqBuilder.Cases<T,NumberExpression<T>>
then(T then)
           
<T extends Number & Comparable<?>>
CaseForEqBuilder.Cases<T,NumberExpression<T>>
thenNumber(Expression<T> then)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaseForEqBuilder

public CaseForEqBuilder(Expression<D> base,
                        Expression<? extends D> other)
Method Detail

then

public <T> CaseForEqBuilder.Cases<T,Expression<T>> then(Expression<T> then)

then

public <T> CaseForEqBuilder.Cases<T,Expression<T>> then(T then)

then

public <T extends Number & Comparable<?>> CaseForEqBuilder.Cases<T,NumberExpression<T>> then(T then)

then

public <T extends Number & Comparable<?>> CaseForEqBuilder.Cases<T,NumberExpression<T>> then(NumberExpression<T> then)

thenNumber

public <T extends Number & Comparable<?>> CaseForEqBuilder.Cases<T,NumberExpression<T>> thenNumber(Expression<T> then)

then

public CaseForEqBuilder.Cases<String,StringExpression> then(StringExpression then)

then

public CaseForEqBuilder.Cases<String,StringExpression> then(String then)


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