Java Map Reverse reverseMap(Map keyIdMap, Map keyValueMap)

Here you can find the source of reverseMap(Map keyIdMap, Map keyValueMap)

Description

reverse Map

License

Open Source License

Declaration

public static <K, G> Map<K, G> reverseMap(Map<String, K> keyIdMap, Map<String, G> keyValueMap) 

Method Source Code

//package com.java2s;

import java.util.HashMap;

import java.util.Map;
import java.util.Map.Entry;

public class Main {
    public static <K, G> Map<K, G> reverseMap(Map<String, K> keyIdMap, Map<String, G> keyValueMap) {
        Map<K, G> ret = new HashMap<K, G>();
        for (Entry<String, G> entry : keyValueMap.entrySet()) {
            K id = keyIdMap.get(entry.getKey());
            ret.put(id, entry.getValue());
        }//from  w w  w . ja va  2 s .  c  o  m
        return ret;
    }
}

Related

  1. reverseMap(Map map)
  2. reverseMap(Map map)
  3. reverseMap(Map map)
  4. reverseMap(Map origMap)
  5. reverseMap(Map map)
  6. reverseMapLookup(Map map, V value)
  7. reverseMapping(Map value2keys, Map map)
  8. reverseMapping(Map map)
  9. sort(Map> dataNodes, boolean reverse)