Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01
This commit is contained in:
commit
9205c736ba
|
|
@ -135,6 +135,15 @@ public class SalaryEntityUtil {
|
|||
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a));
|
||||
}
|
||||
|
||||
public static <T, K, V> Map<K, V> convert2LinkedMap(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return objs.stream()
|
||||
.filter(e -> valueMapper.apply(e) != null && keyMapper.apply(e) != null)
|
||||
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a, LinkedHashMap::new));
|
||||
}
|
||||
|
||||
public static <R, T> Map<R, List<T>> group2Map(Collection<T> objs, Function<T, R> function) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
|
|
|
|||
Loading…
Reference in New Issue