I have a (Java-Library-) Class `JsonSerde<T>...
# announcements
h
I have a (Java-Library-) Class
JsonSerde<T>
with a constructor
JsonSerde(Class<T> clazz, ObjectMapper mapper)
. How do I create an instance
JsonSerde<MutableMap<String, Any>>
? I tried
JsonSerde(MutableMap::class.java, objectMapper)
, but I get a Expected type mismatch … found
JsonSerde<MutableMap<*, *>>
I also tried
JsonSerde(MutableMap<String, Any>::class.java, objectMapper)
, but then I get Only classes are allowed on the left hand side of a class literal. Is an explicit cast (ugly and verbose) really the only way?