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 aCaseExpression
.- 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
All Methods Instance Methods Concrete Methods 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 Detail
-
condition
private final Restriction condition
-
value
private final Expression value
-
-
Constructor Detail
-
WhenStatement
public WhenStatement(Restriction condition, Expression value)
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 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
-
equals
public boolean equals(Object other)
This statement is equal to another WhenStatement if both have equal conditions and values.
-
-