← Back to Stormify Documentation

castScalar

fun <T : Any> castScalar(targetClass: KClass<T>, value: Any?): T?

Convert a scalar value to the target class.

Return

the converted value, or null if value is null

Throws

if conversion is not possible