将map集合中的数据转化为指定对象的同名属性中
(Map<String, Object> map, Class<T> clazz)
| 325 | * 将map集合中的数据转化为指定对象的同名属性中 |
| 326 | */ |
| 327 | public static <T> T mapToBean(Map<String, Object> map, Class<T> clazz) throws Exception { |
| 328 | T bean = clazz.newInstance(); |
| 329 | BeanMap beanMap = BeanMap.create(bean); |
| 330 | beanMap.putAll(map); |
| 331 | return bean; |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * 如果返回null则表示没有错误 |
nothing calls this directly
no outgoing calls
no test coverage detected