mp
03/26/2020, 4:35 PMSam Garfinkel
03/26/2020, 6:02 PMprintln(ThingAndBoxedTypeRef.of<String>("a string").typeRef.type)Oscar
03/26/2020, 6:52 PMinline fun <reified T> of(thing: T) =
ThingAndBoxedTypeRef(thing, jacksonTypeRef<T>())araqnid
03/26/2020, 9:12 PMBox<T> output for thataraqnid
03/26/2020, 9:12 PMjacksonTypeRef<Box<T>>() to supply the explicit type parameter therearaqnid
03/26/2020, 9:14 PMtypeFactory.constructParametricType(Box::class.java, typeFactory.constructType(jacksonTypeRef<T>()))
Although this gives a JavaType rather than a TypeReference (which is just a type token way of making parameterised types easier to specify in source)araqnid
03/26/2020, 9:14 PMSam Garfinkel
03/27/2020, 1:21 PMSam Garfinkel
03/27/2020, 1:22 PMmp
03/27/2020, 1:40 PMmp
03/27/2020, 1:42 PMobject : TypeReference didn't help