Search code examples
javapojolinkedhashmap

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?


Solution

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