首页 > 编程知识 正文

map集合转对象,对象转map工具类

时间:2023-05-05 07:29:00 阅读:179656 作者:4240

//importorg.Apache.com mons.beanutils.beanutils; publicstatictdecode (classt clazz,MapString,String msg ) { try { T cls=clazz.newInstance; SetMap.EntryString,String entrySet=msg.entrySet (; 映射条目字符串,字符串条目:条目(for ) beanutils.setproperty(cls,entry.getKey ),条目. getvalue )。 } return cls; }catch(exceptione ) { e.printStackTrace ); }返回空值; () ) ) ) )。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。