我有一个功能:
inline fun <reified T : Any>parse(result: String): T = mapper.readValue<Response<T>>(result).someValue
Run Code Online (Sandbox Code Playgroud)
当我传递一个列表类型,例如List<MyClass>,并尝试从中获取一些项目时,我得到以下异常:
Exception in thread "ForkJoinPool.commonPool-worker-3"
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to MyClass
Run Code Online (Sandbox Code Playgroud)