需求总是千奇百怪,对象转成map,看似没必要,但就是有这个需求,所以记录下来 首先是Bean 然后是主要方法和测试类 输出 ...
public static Map transBean Map Object obj if obj null return null Map map new HashMap try BeanInfo beanInfo Introspector.getBeanInfo obj.getClass PropertyDescriptor propertyDescriptors beanInfo.getP ...
2018-08-29 19:56 0 1392 推荐指数:
需求总是千奇百怪,对象转成map,看似没必要,但就是有这个需求,所以记录下来 首先是Bean 然后是主要方法和测试类 输出 ...
标注:抄袭 ...
String jsonStr = deviceLnspection.getTimeConfig(); JSONArray array = JSONUtil.parseArray(jsonStr); List<Map<String, Object>> timeConfig ...
...
把map转成json需要一些jar <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --> dependency> ...
...
将Java对象转换成Map的键值对形式 代码: 该代码共享于github中 github地址 ...