Bernhard
11/21/2018, 10:16 AMdiesieben07
11/21/2018, 10:18 AMClass<T>
or Class<String>
after compilation, only Class
.
But if you do T::class
with a reified T
, then you will get the proper Class
instance.Bernhard
11/21/2018, 10:25 AMmapper.fromJson<ArrayList<AdditionalFunction>>(it, object : TypeToken<ArrayList<AdditionalFunction>>() {}.type)
mapper.fromJson<ArrayList<T>>(it, object : TypeToken<ArrayList<T>>() {}.type)
diesieben07
11/21/2018, 10:28 AMBernhard
11/21/2018, 10:28 AMfunc<AdditionalFunction>()
diesieben07
11/21/2018, 10:33 AMprivate inline fun <reified R> a() {
println(object : TypeToken<R>() {})
}
fun main(args: Array<String>) {
a<ArrayList<String>>()
}
Bernhard
11/21/2018, 10:34 AMdiesieben07
11/21/2018, 10:37 AM