package com.infoepoch.pms.dispatchassistant.common.utils;

import java.util.Map;
import java.util.stream.Collectors;

public class MapTool {

    /**
     * MAP反转
     *
     * @param map
     * @param <K>
     * @param <V>
     * @return
     */
    public static <K, V> Map<V, K> mapReverse(Map<K, V> map) {
        return map.entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));
    }

}
