02 2022 档案
摘要:用JSONObject.toJSONString(object,SerializerFeature.WriteMapNullValue) 可以解决 出错: JSONObject json = new JSONObject(); json.toString() // null的字段被过滤 正确: JS
阅读全文
摘要:用Apache Commons Collections下的ListUtils.partition进行分割 ListUtils.partition(list, size); List<Long> list = new ArrayList<>(); for (int j=0; j<10; j++){ L
阅读全文
摘要:方法1 先把Object数组转成固定长度的list 遍历该list,把每个Object对象转成String对象,再转成Long对象 public void castDemo(Object[] ids) { List<Object> dels = Arrays.asList(ids); for (Ob
阅读全文