2.17.2: 2011-06-17

net.sf.basedb.core.query
Class WhenStatement

java.lang.Object
  extended by net.sf.basedb.core.query.WhenStatement

public class WhenStatement
extends Object

Create a WHEN statement to be used in a CaseExpression.

Version:
2.0
Author:
nicklas
See Also:
Expressions.caseWhen(Expression, WhenStatement[])
Last modified
$Date: 2010-04-21 11:48:29 +0200 (Wed, 21 Apr 2010) $

Field Summary
private  Restriction condition
           
private  Expression value
           
 
Constructor Summary
WhenStatement(Restriction condition, Expression value)
          Create a new WhenStatement
 
Method Summary
 boolean equals(Object other)
          This statement is equal to another WhenStatement if both have equal conditions and values.
 Restriction getCondition()
          Get the condition of this statement.
 Expression getValue()
          Get the value returned by this statement
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

condition

private final Restriction condition

value

private final Expression value
Constructor Detail

WhenStatement

public WhenStatement(Restriction condition,
                     Expression value)
Create a new WhenStatement

Parameters:
condition - The condition that is controlling if this value is returned or not, null is not allowed
value - The value to return if the condition is TRUE, null is not allowed
Method Detail

getCondition

public Restriction getCondition()
Get the condition of this statement.

Returns:
A Restriction object

getValue

public Expression getValue()
Get the value returned by this statement

Returns:
An Expression object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
This statement is equal to another WhenStatement if both have equal conditions and values.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

2.17.2: 2011-06-17