Create a case expression builder

@param other
@return case expression builder
429216
public CaseForEqBuilder<T> when(T other) {
        return new CaseForEqBuilder<T>(mixin, ConstantImpl.create(other));
    }
539374
@Nullable
    public T orElse(@Nullable T other) {
        return value != null ? value : other;
    }
600182
public SimpleExpression<T> nullif(Expression<T> other) {
        return Expressions.operation(this.getType(), Ops.NULLIF, this, other);
    }
74113
public Predicate<T> or( final Predicate<T> other ) {
        if (other == null || other == this) return this;
        return new Predicate<T>() {
            @Override
            public boolean test( T input ) {
                return Predicate.this.test(input) || other.test(input);
            }
        };
    }
1086111
public Permutation multiply(Permutation other) {
        Permutation newPermutation = new Permutation(values.length);
        for (int i = 0; i < values.length; i++) {
            newPermutation.values[i] = this.values[other.values[i]];
        }
        return newPermutation;
    }
1104994
public SwitchBuilder addCase(ImmutableList<Expression> caseLabels, Statement body) {
    Preconditions.checkState(!caseLabels.isEmpty(), "at least one case required");
    clauses.add(new Switch.CaseClause(caseLabels, body));
    return this;
  }
638631
public static <T extends Case1<A>, A> DecomposableMatchBuilder0<T> case1(
      Class<T> clazz, MatchesExact<A> a) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(a.t));
    return new DecomposableMatchBuilder0<T>(matchers, new Case1FieldExtractor<>(clazz));
  }
642441
def add(other)
      case other
      when LinExpr
        @terms.merge!(other.terms) { |_, c1, c2| c1 + c2 }
      when Variable
        if @terms.key? other
          @terms[other] += 1.0
        else
          @terms[other] = 1.0
        end
      else
        fail TypeError
      end

      self
    end
825066
private Expression readCaseWhen(final Expression l) {

        readThis(Tokens.WHEN);

        Expression condition = null;

        if (l == null) {
            condition = XreadBooleanValueExpression();
        } else {
            while (true) {
                Expression newCondition = XreadPredicateRightPart(l);

                if (l == newCondition) {
                    newCondition =
                        new ExpressionLogical(l, XreadRowValuePredicand());
                }

                if (condition == null) {
                    condition = newCondition;
                } else {
                    condition = new ExpressionLogical(OpTypes.OR, condition,
                                                      newCondition);
                }

                if (token.tokenType == Tokens.COMMA) {
                    read();
                } else {
                    break;
                }
            }
        }

        readThis(Tokens.THEN);

        Expression current  = XreadValueExpression();
        Expression elseExpr = null;

        if (token.tokenType == Tokens.WHEN) {
            elseExpr = readCaseWhen(l);
        } else if (token.tokenType == Tokens.ELSE) {
            read();

            elseExpr = XreadValueExpression();

            readThis(Tokens.END);
            readIfThis(Tokens.CASE);
        } else {
            elseExpr = new ExpressionValue((Object) null, Type.SQL_ALL_TYPES);

            readThis(Tokens.END);
            readIfThis(Tokens.CASE);
        }

        Expression alternatives = new ExpressionOp(OpTypes.ALTERNATIVE,
            current, elseExpr);
        Expression casewhen = new ExpressionOp(OpTypes.CASEWHEN, condition,
                                               alternatives);

        return casewhen;
    }
15638
@Nullable
    public T getOrElse(@Nullable T other) {
        return throwable == null ? value : other;
    }
496955
public ExpressionBuilder not(final ExpressionBuilder exp) {
		// Note - NOT Expressions are not added to the stack (like the other group expressions AND and OR) and are
		// treated the same as a "compare" expression.
		// It is expected a NOT Expression is used by itself or with an AND or NOT.
		GroupExpression not = new GroupExpression(Type.NOT);
		not.add(exp.expression.getExpression());

		appendExpression(not);

		return this;
	}
824842
@Nonnull
	public <V1 extends T1, V2 extends T2, V3 extends T3> LToIntTriFunctionBuilder<T1, T2, T3> aCase(Class<V1> argC1, Class<V2> argC2, Class<V3> argC3, LToIntTriFunction<V1, V2, V3> function) {
		PartialCaseWithIntProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)) && (argC3 == null || argC3.isInstance(a3)));

		pc.evaluate(function);
		return self();
	}
836329
@Nonnull
	public <V extends T> LObjBiIntPredicateBuilder<T> casesOf(Class<V> argC1, Consumer<LObjBiIntPredicateBuilder<V>> pcpConsumer) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
632293
@Nonnull
	public <V extends T> LConsumerBuilder<T> casesOf(Class<V> argC, Consumer<LConsumerBuilder<V>> pcpConsumer) {
		PartialCase.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
633017
protected CaseExecutionImpl createCaseExecution(CmmnActivity activity) {
    CaseExecutionImpl child = newCaseExecution();

    // set activity to execute
    child.setActivity(activity);

    // handle child/parent-relation
    child.setParent(this);
    getCaseExecutionsInternal().add(child);

    // set case instance
    child.setCaseInstance(getCaseInstance());

    // set case definition
    child.setCaseDefinition(getCaseDefinition());

    return child;
  }
1128696
final public ThenExpressionBuilder<T> ifExp() {
    return new ThenExpressionBuilder<T>(new ExpressionHandler<ThenBuilder<T>>() {
      public ThenBuilder<T> handleExpression(final Expression e) {
        return new ThenBuilder<T>(e, new IfStatementHandler<T>() {
          public T handleStatement(IfStatement ifStatement) {
            return statementHandler().handleStatement(ifStatement);
          }
        }, builder);
      }
    });
  }
465838
public static ListValue of(Key first, Key... other) {
    return newBuilder().addValue(first, other).build();
  }