← Back to Stormify Documentation

safeCast

inline fun <T> Any?.safeCast(): T

Safe cast helper for parameter validation.

Performs a safe cast with descriptive error messages for type mismatches. Used throughout KDBC for validating parameter types before use.

Return

The safely cast value

Type Parameters

T

The target type to cast to (automatically derived from reified type)

Throws

if the cast fails