02 2022 档案

摘要:用JSONObject.toJSONString(object,SerializerFeature.WriteMapNullValue) 可以解决 出错: JSONObject json = new JSONObject(); json.toString() // null的字段被过滤 正确: JS 阅读全文
posted @ 2022-02-17 16:50 张三丰学Java 阅读(357) 评论(0) 推荐(0) 编辑
摘要:用Apache Commons Collections下的ListUtils.partition进行分割 ListUtils.partition(list, size); List<Long> list = new ArrayList<>(); for (int j=0; j<10; j++){ L 阅读全文
posted @ 2022-02-16 11:10 张三丰学Java 阅读(1525) 评论(0) 推荐(0) 编辑
摘要:方法1 先把Object数组转成固定长度的list 遍历该list,把每个Object对象转成String对象,再转成Long对象 public void castDemo(Object[] ids) { List<Object> dels = Arrays.asList(ids); for (Ob 阅读全文
posted @ 2022-02-15 12:00 张三丰学Java 阅读(2626) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示