Java Map Join join(List> list)

Here you can find the source of join(List> list)

Description

join

License

Apache License

Declaration

public static <K, V> Map<K, V> join(List<Map<K, V>> list) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;

import java.util.List;
import java.util.Map;

public class Main {

    public static <K, V> Map<K, V> join(List<Map<K, V>> list) {
        if (list == null) {
            return null;
        }//from   w ww .  j av  a 2 s . c  om
        Map<K, V> result = new HashMap<K, V>();
        for (int i = 0; i < list.size(); i++) {
            Map<K, V> map = list.get(i);
            if (map != null) {
                result.putAll(map);
            }
        }
        return result;
    }
}

Related

  1. join(final long timeout, final Map throwableMap, final Thread... threads)
  2. join(final Map map1, final Map map2, final Map... maps)
  3. join(final Map add, final Map... imports)
  4. Join(Map map, String entryGlue, String elementGlue)
  5. join(Map dst, Map src)
  6. join(Map map, String separator)
  7. joinAll(Map> map, String separator)