Package net.sf.basedb.core.query
Class WhenStatement
java.lang.Object
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: 2014-10-22 18:41:55 +0200 (on, 22 okt 2014) $
-
Field Summary
Fields Modifier and Type Field Description private Restriction
condition
private Expression
value
-
Constructor Summary
Constructors Constructor Description WhenStatement(Restriction condition, Expression value)
Create a newWhenStatement
-
Method Summary
Modifier and Type Method Description 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 statementint
hashCode()
String
toString()
-
Field Details
-
condition
-
value
-
-
Constructor Details
-
WhenStatement
Create a newWhenStatement
- Parameters:
condition
- The condition that is controlling if this value is returned or not, null is not allowedvalue
- The value to return if the condition is TRUE, null is allowed
-
-
Method Details
-
getCondition
Get the condition of this statement.- Returns:
- A
Restriction
object
-
getValue
Get the value returned by this statement- Returns:
- An
Expression
object
-
toString
-
equals
This statement is equal to another WhenStatement if both have equal conditions and values. -
hashCode
public int hashCode()
-