集合转map 排序

Map<Long, SkuInventory> skuInventoryListMap = skuInventoryList.stream().collect(Collectors.toMap(SkuInventory::getId, value -> value));


demandNodeLogs.sort(Comparator.comparing(DemandNodeLog::getNodeType, Comparator.nullsFirst(Comparator.naturalOrder())));
 
上一篇:Arrays.sort详解


下一篇:还是java牛逼,一行代码搞定各种排序