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 Details

  • Constructor Details

    • 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 allowed
  • Method Details

    • 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