yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.qianwen.smartman.modules.mdc.utils;
 
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import com.qianwen.smartman.modules.cps.dto.KeyNameDTO;
 
public class MdcConvertUtil {
    private MdcConvertUtil() {
    }
 
    public static Map<String, String> keyNameToMap(List<KeyNameDTO> keyNameList) {
        return Optional.ofNullable(keyNameList).orElse(new ArrayList<>()).stream().collect(Collectors.toMap((v0) -> {
            return v0.getKey();
        }, (v0) -> {
            return v0.getName();
        }));
    }
}