toOrDefault

fun <T> toOrDefault(valueTransformer: CommanderValueTransformer<T>, default: T): T(source)

Convert the value to a specific type (using a CommanderValueTransformer) or a default value

Return

the transformed value or the default value

Since

0.1.0

Parameters

T

the type of the value

valueTransformer
default

the default value

See also


fun <T> toOrDefault(valueTransformer: CommanderValueTransformerLambda<T>, default: T): T(source)

Convert the value to a specific type (using a CommanderValueTransformerLambda) or a default value

Return

the transformed value or the default value

Since

0.1.0

Parameters

T

the type of the value

valueTransformer
default

the default value

See also