then

open infix fun <R : Any, T> Value<R, Boolean>.then(value: Value<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenByField")
open infix fun <R : Any, T> Value<R, Boolean>.then(value: Field<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenByProperty")
open infix fun <R : Any, T> Value<R, Boolean>.then(value: KProperty1<R, T>): ConditionalValueOperators.Case<R, T>(source)
infix inline fun <R : Any, T> Value<R, Boolean>.then(value: T): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenFieldReceiverByValue")
open infix fun <R : Any, T> Field<R, Boolean>.then(value: Value<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenFieldReceiverByField")
open infix fun <R : Any, T> Field<R, Boolean>.then(value: Field<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenFieldReceiverByProperty")
open infix fun <R : Any, T> Field<R, Boolean>.then(value: KProperty1<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenFieldReceiverByResult")
infix inline fun <R : Any, T> Field<R, Boolean>.then(value: T): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenPropertyReceiverByValue")
open infix fun <R : Any, T> KProperty1<R, Boolean>.then(value: Value<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenPropertyReceiverByField")
open infix fun <R : Any, T> KProperty1<R, Boolean>.then(value: Field<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenPropertyReceiverByProperty")
open infix fun <R : Any, T> KProperty1<R, Boolean>.then(value: KProperty1<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenPropertyReceiverByResult")
infix inline fun <R : Any, T> KProperty1<R, Boolean>.then(value: T): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenResultReceiverByValue")
infix inline fun <R : Any, T> Boolean.then(value: Value<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenResultReceiverByField")
infix inline fun <R : Any, T> Boolean.then(value: Field<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenResultReceiverByProperty")
infix inline fun <R : Any, T> Boolean.then(value: KProperty1<R, T>): ConditionalValueOperators.Case<R, T>(source)
@JvmName(name = "thenResultReceiverByResult")
infix inline fun <R : Any, T> Boolean.then(value: T): ConditionalValueOperators.Case<R, T>(source)

Instantiates a Case for the switch operator.

Example

class User(
val name: String,
val score: Int,
val role: String,
val bonus: Int?,
)

users.updateManyWithPipeline {
set {
User::bonus set switch(
User::role eq "GUEST" then 5,
User::role eq "EMPLOYEE" then 6,
User::role eq "ADMIN" then 7,
default = -1,
)
}
}

See also