java - Jackson JSON ObjectMapper.readvalue -
java - Jackson JSON ObjectMapper.readvalue -
i'm going through code examples on converting java object json , came across this:
hashmap<string, object> filters = new objectmapper().readvalue(filterstr, hashmap.class);
where
string filterstr;
sorry, above line of code doing? went through other illustration here. can see readvalue() has been overridden how can string converted hashmap? shouldn't json object , not string? thanks.
objectmapper().readvalue()
is overloaded several types of conversions.
if filterstr compatible converted hashmap method it.
e.g. filterstr = "{\"name\":\"tom\", \"age\":\"25\"}";
give map key-value pairs {age=25, name=tom}
java json jackson
Comments
Post a Comment