Java常用转换

 1.list 互转:ServiceStandardAllVo为你要得到的,serviceStandardEntity为你要转的

​
List serviceStanderdAllVo1 =JSONObject.parseArray(JSONObject.toJSONString(serviceStandardEntity),ServiceStandardAllVo.class);

​

2.对象互转:使用同上

SysUserEntity sysUserEntity = JSONObject.parseObject(JSONObject.toJSONString(SecurityUtils.getSubject().getPrincipal()), SysUserEntity.class);

你可能感兴趣的:(Java,Java,类型转换,对象互转)