kamaci
kamaci

Reputation: 75137

LinkedHashMap to Pojo

I have a variable that is a linked hash map. Its like:

"message": "something"
"code": "0"

and I have a pojo:

String message;
Integer code;
//getters and setters

Is there any library that converts a linkedhasmap into a pojo?

Upvotes: 3

Views: 1847

Answers (2)

Dave Newton
Dave Newton

Reputation: 160201

Apache Commons BeanUtils has a populate() method that moves map values into a bean.

Upvotes: 6

rai.skumar
rai.skumar

Reputation: 10677

Just iterate map and create a list of POJO object.

Upvotes: 0

Related Questions