https://kotlinlang.org logo
#jackson-kotlin
Title
# jackson-kotlin
j

Jgafner

10/07/2020, 10:06 AM
Hi all. I am trying to understand the equivalent for Mapping Nested Values with Jackson for example:
Copy code
public class SimpleClass {

    private String path;

    @JsonProperty("somePath")
    private void unpackPath(Map<String, Object> somePath) {
        this.path = (String) somePath.get("toString");
    }
}
When I use the IDE convertor I am getting this:
Copy code
class SimpleClass {
    private var path: String? = null
    @JsonProperty("somePath")
    private fun unpackPath(somePath: Map<String, Any>) {
        path = somePath["toString"] as String?
    }
}
Is that correct ?
d

dinomite

10/07/2020, 1:55 PM
I haven’t ever used nested properties, but that seems correct to me after having read https://stackoverflow.com/a/41383076/17339
Is the incoming
Map
really
String
to any object?
4 Views