I'm trying to use a Jackson's ObjectMapper() function: convertValue.
It takes 2 parameters (3 overloads):
- (Object, Call)
- (Object, TypeReference)
- (Object, JavaType)
I have the following code:
val m = new ObjectMapper()
val map: Map[String, Object] = m.convertValue(bean, classOf[Map])
which doesn't work with error Type Mismatch. Expected JavaType actual Class[Map].
I tested with classOf[java.util.Map], Map.getClass, etc. but can't make it work.
How should I send that parameter?