package com.storlead.system.util;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * @program: sp-sales-platform
 * @description:
 * @author: chenkq
 * @create: 2024-05-22 10:31
 */
public class MapUtil {
    public static Map<String, String> swapKeysAndValues(Map<String, String> map) {
        Map<String, String> swappedMap = new HashMap<>();
        if (Objects.isNull(map)) {
            return swappedMap;
        }
        for (Map.Entry<String, String> entry : map.entrySet()) {
            swappedMap.put(entry.getValue(), entry.getKey());
        }
        return swappedMap;
    }

}
