Java Map Remove removeGeneric( List> list)

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

Description

remove Generic

License

Apache License

Declaration

public static <T> List<Map<String, Object>> removeGeneric(
        List<Map<String, T>> list) 

Method Source Code

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

import java.util.ArrayList;

import java.util.HashMap;

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

public class Main {

    public static <T> List<Map<String, Object>> removeGeneric(
            List<Map<String, T>> list) {
        if (list == null) {
            return null;
        }//w ww  .j a v a2 s .  c  o  m
        List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
        for (int i = 0; i < list.size(); i++) {
            Map<String, T> map = list.get(i);
            Map<String, Object> newMap = new HashMap<String, Object>();
            newMap.putAll(map);
            result.add(newMap);
        }
        return result;
    }
}

Related

  1. removeEmptyValues(Map params)
  2. removeExistingItemsFromProvided(Map existingItems, Map providedItems)
  3. removeFrom(Map map, K key)
  4. removeFromMap( Map map, K key, V value)
  5. removeFromMapValues(final Map map, final Object value)
  6. removeHeader(Map headers, String header)
  7. removeKeyAndConvertToListOfMaps( Object obj, String key)
  8. removeKeys(Collection keys, Map map)
  9. removeKeysWithPrefix(Map map, String prefix)