How to convert Map object as an entity class object

<dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.1.46.sec01</version>
        </dependency>
JSON.parseObject(JSON.toJSONString(Map<String, ? extends Object>), Class<T> cls);

Another method is the class BeanUtils

BeanUtils.populate(Object bean, Map<String, ? extends Object> properties)

 

Guess you like

Origin www.cnblogs.com/du001011/p/11324836.html