Class Case


  • @Experimental
    @Public
    public class Case
    extends Object
    DSL for creating CASE...END constructs.
    Since:
    2.2
    Author:
    Simon Baslé
    • Constructor Detail

      • Case

        public Case()
    • Method Detail

      • caseSimple

        public static Case.WhenClause caseSimple​(Expression expected)
        Constructs a "simple case" expression. Initial caseExpression will be compared to each WHEN clause for equality, and if it matches the corresponding THEN expression will be returned. If no WHEN-THEN matches, the ELSE expression is returned. If no ELSE was provided, NULL is returned.
        Parameters:
        expected - the initial caseExpression on which to match.
      • caseSearch

        public static Case.WhenClause caseSearch()
        Constructs a "search case" expression. Each WHEN clause will have its condition inspected in turn, and if it holds true the corresponding THEN expression will be returned. If no WHEN-THEN matches, the ELSE expression is returned. If no ELSE was provided, NULL is returned.