https://kotlinlang.org logo
#reflect
Title
# reflect
j

jdiaz

08/19/2018, 9:01 PM
Does anyone know how to get the generic type of List<List<T>>? I'd first have List<List<T>> but parsing that would go to List<T> and then T. But I'm getting null in the second operation
d

diesieben07

08/20/2018, 6:00 AM
Depending on where you get that type from the type information might not be present.
j

jdiaz

08/21/2018, 3:45 PM
I've ended up doing the TypeReference and creating and object containing all that information at runtime. I'm still struggling a little bit with the Wildcard and Parameterized Types but yeah, working on it.
If anyone is interested, I've just commited all the changes and this is the converter: https://github.com/jdiazcano/cfg4k/blob/master/cfg4k-core/src/main/kotlin/com/jdiazcano/cfg4k/utils/TargetType.kt
2 Views