集合转map 排序

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


demandNodeLogs.sort(Comparator.comparing(DemandNodeLog::getNodeType, Comparator.nullsFirst(Comparator.naturalOrder())));
 
原文地址:https://www.cnblogs.com/xiaxinggege/p/14346915.html