逗号分割字符串转list 字符串转List
借助于Arrays.asList实现
示例代码如下
String str = "a,b,c";
List<String> result = Arrays.asList(str.split(","));
借助于Arrays.asList实现
String str = "a,b,c";
List<String> result = Arrays.asList(str.split(","));
借助于apache commens util包的BeanUtils
Bean bean = new Bean()
Map map = BeanUtils.describe(bean);
Map<String, String> params = new HashMap<>();
Map<String,String[]> requestParams = request.getParameterMap();
requestParams.forEach((key, value) -> {
params.put(key,value[0]);
});