Interface CqnCaseExpression

All Superinterfaces:
CqnExpression, CqnToken, CqnValue, JSONizable

public interface CqnCaseExpression extends CqnExpression
A case expression, which represents IF - THEN - ELSE logic. The result value is determined by evaluating a list of cases. If a CqnCaseExpression.Case.condition() of a case evaluates to TRUE the result value of the case is returned. If no condition of any case evaluates to TRUE the default value is returned.
  • Method Details

    • cases

      The cases, which are evaluated.
      Returns:
      the cases
    • defaultValue

      CqnValue defaultValue()
      The default value, which is returned if no condition of any case matches
      Returns:
      the default value
    • isCaseExpression

      default boolean isCaseExpression()
      Description copied from interface: CqnExpression
      Returns true if this is a CqnCaseExpression.
      Specified by:
      isCaseExpression in interface CqnExpression
      Returns:
      true if this is a case expression, otherwise false
    • asCaseExpression

      default CqnCaseExpression asCaseExpression()
      Description copied from interface: CqnExpression
      Casts this expression to a CqnCaseExpression.
      Specified by:
      asCaseExpression in interface CqnExpression
      Returns:
      this as a case expression
    • accept

      default void accept(CqnVisitor visitor)
      Description copied from interface: CqnToken
      Traverses the expression tree represented by this token with a given visitor. The traversal order is depth-first. If this token has child nodes they are traversed first by dispatching the visitor to the children's accept methods. Afterwards this token is passed to the visitor's visit method specific for this token's type.
      Specified by:
      accept in interface CqnExpression
      Specified by:
      accept in interface CqnToken
      Parameters:
      visitor - the CqnVisitor