# ValueCase

class ValueCase<T>(val value: ExpressionWithColumnType<T>)

Builder class for creating value-based CASE expressions where a specific value is compared against different conditions.

#### Parameters

value

The expression whose value will be compared in WHEN clauses

#### Type Parameters

T

The type of the value being compared

## Constructors

ValueCase
Link copied to clipboard
constructor(value: ExpressionWithColumnType<T>)

## Properties

value
Link copied to clipboard
val value: ExpressionWithColumnType<T>

## Functions

When
Link copied to clipboard
fun <R> When(cond: T, result: Expression<R>): ValueCaseWhen<T, R>

Adds a WHEN clause that compares the case value against a literal condition.

fun <R> When(cond: Expression<T>, result: Expression<R>): ValueCaseWhen<T, R>

Adds a WHEN clause that compares the case value against an expression condition.

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

Adds a WHEN clause that compares the case value against a literal condition with a literal result.

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

Adds a WHEN clause that compares the case value against an expression condition with a literal result.