bean转map
public static Map beanToMap(T bean) {
Map map = new HashMap<>();
if (bean != null) {
BeanMap beanMap = BeanMap.create(bean);
for (Object key : beanMap.keySet()) {
map.put(key.toString(), beanMap.get(key));
}
}
return map;
}
List
public staticList
字符串转JSONObject
String s =""; JSONObject json = JSON.parseObject(s,JSONObject.class);
字符串转List
Listlist = JSON.parseArray(s,Entity.class);
Entity实体类转JSONObject
JSONObject json =(JSONObject)JSONObject .toJSON(Entity);
List转数组
Listlist = Lists.newArrayList(); String[] strings = list.toArray(new String[list.size()]);
数组转集合
String[] strings = list.toArray(new String[list.size()]); Liststrings = Arrays.asList(strings);



