随笔分类 -  Java

摘要:1.登陆官网:https://www.oracle.com 2.显示出下载页面 3.找到Java 4.点击Java(JDK) for Developers 5.选择JDK1.8 阅读全文

posted @ 2020-03-04 07:21 wzhw2015 阅读(144) 评论(0) 推荐(0) 编辑 |

摘要:Map<String,Bean> map = list.stream().collect(Collectors.toMap(bean -> bean.getItemA(),bean->bean)); 阅读全文

posted @ 2020-02-29 14:35 wzhw2015 阅读(1810) 评论(0) 推荐(0) 编辑 |

摘要:Map<String,String> itemMap = itemList.stream.collect(Collectors.toMap(Bean::getItemA,Bean::getItemB)); 阅读全文

posted @ 2020-02-29 11:10 wzhw2015 阅读(208) 评论(0) 推荐(0) 编辑 |

摘要:public static <T> List<List<T>> split(List<T> sourceList, int count) { List<List<T>> resultList = new ArrayList<>(); int size = sourceList.size(); if 阅读全文

posted @ 2020-02-29 10:42 wzhw2015 阅读(936) 评论(0) 推荐(0) 编辑 |

摘要:List<String> itemList = itemMap.entrySet().stream() .collect(Collectors.groupingBy(e -> e.getKey().substring(11))) .keySet() .stream() .map(key -> key 阅读全文

posted @ 2020-02-29 10:31 wzhw2015 阅读(592) 评论(0) 推荐(0) 编辑 |

摘要:List<String> itemList = list.stream().collect(Collectors.groupingBy(Bean::getItem)).keySet().stream().map(key -> key).collect(Collectors.toList()); 阅读全文

posted @ 2020-02-29 09:56 wzhw2015 阅读(1440) 评论(0) 推荐(0) 编辑 |

摘要:1.一个一个项目的分组合计 list.stream().collect( Collectors..groupingBy( Bean::getItemA ,Collectors..groupingBy( Bean::getItemB, Collectors..reducing( new Bean(), 阅读全文

posted @ 2020-02-29 09:13 wzhw2015 阅读(672) 评论(0) 推荐(0) 编辑 |

摘要:1.item1升序,item2升序,item3(存在NULL项目,NULL项目排在后面)升序 Collections.sort(list, Comparator.comparing(Bean::getItem1) .thenComparing(Bean::getItem2) .thenCompari 阅读全文

posted @ 2020-02-26 22:36 wzhw2015 阅读(161) 评论(0) 推荐(0) 编辑 |

摘要:Map<String, List<Bean>> orderMap = list.stream().collect(Collectors.groupingBy(Bean::getItem1, LinkedHashMap::new, Collectors.toCollection(ArrayList:: 阅读全文

posted @ 2020-02-26 22:32 wzhw2015 阅读(364) 评论(0) 推荐(0) 编辑 |

摘要:1.新创建一个对象 long startTimeA = System.currentTimeMillis(); StringBuilder sb = null; for (int i = 1; i <= 10000000; i++) { sb = new StringBuilder(); sb.ap 阅读全文

posted @ 2020-02-26 22:30 wzhw2015 阅读(110) 评论(0) 推荐(0) 编辑 |

摘要:Map<String, List<Model>> modelMap = modelList .stream() .collect(Collectors .toMap(model -> model.getDate(), model -> new ArrayList<Model>(Arrays.asLi 阅读全文

posted @ 2020-02-20 09:09 wzhw2015 阅读(808) 评论(0) 推荐(0) 编辑 |

Copyright © 2024 wzhw2015
Powered by .NET 8.0 on Kubernetes