# When

fun When(cond: Expression<*>, result: Expression<T>): CaseWhen<T>

Adds a conditional expression with a result if the condition evaluates to true.

#### Return

This CaseWhen instance for method chaining

#### Parameters

cond

The boolean condition to evaluate

result

The expression to return if the condition is true

fun When(cond: Expression<T>, result: T, resultType: IColumnType<T & Any>? = null): CaseWhen<T>

Adds a conditional expression with a literal result if the condition evaluates to true.

#### Return

This CaseWhen instance for method chaining

#### Parameters

cond

The boolean condition to evaluate

result

The literal value to return if the condition is true

resultType

Optional column type for the result value