Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 800
kamaci Avatar asked Aug 30 '26 13:08

kamaci


1 Answers

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

like image 69
Dave Newton Avatar answered Sep 01 '26 03:09

Dave Newton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!