What is the equivalent of the mapping nested value? For i.e.:
// ...
@SuppressWarnings("unchecked")
@JsonProperty("brand")
private void unpackNested(Map<String,Object> brand) {
this.brandName = (String)brand.get("name");
Map<String,String> owner = (Map<String,String>)brand.get("owner");
this.ownerName = owner.get("name");
}
}
Thanks
If I convert this from Java to Kotlin in the ide:
public class SimpleClass {
private String path;
@JsonProperty("somePath")
private void unpackPath(Map<String, Object> somePath) {
this.path = (String) somePath.get("toString");
}
}
I am getting this:
class SimpleClass {
private var path: String? = null
@JsonProperty("somePath")
private fun unpackPath(somePath: Map<String, Any>) {
path = somePath["toString"] as String?
}
}
Is this the right way to do it ?