toSingleOf

abstract fun <T> toSingleOf(kType: KType, params: Map<String, Any?> = emptyMap()): DataResult<T>

Maps the result to a single object of the given type. Works on the same mapping principle as toListOf. Nullability is determined by the KType: use toSingleOf<User>() for non-null or toSingleOf<User?>() for nullable results.