Java Map Remove removeFrom(Map map, K key)

Here you can find the source of removeFrom(Map map, K key)

Description

remove From

License

Open Source License

Declaration

public static <K, V> V removeFrom(Map<? super K, V> map, K key) 

Method Source Code

//package com.java2s;
/*/*from ww  w . j a v a  2s.c  o  m*/
 *
 *  Managed Data Structures
 *  Copyright ? 2016 Hewlett Packard Enterprise Development Company LP.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  As an exception, the copyright holders of this Library grant you permission
 *  to (i) compile an Application with the Library, and (ii) distribute the 
 *  Application containing code generated by the Library and added to the 
 *  Application during this compilation process under terms of your choice, 
 *  provided you also meet the terms and conditions of the Application license.
 *
 */

import java.util.Map;

public class Main {
    public static <K, V> V removeFrom(Map<? super K, V> map, K key) {
        if (map == null) {
            return null;
        }
        return map.remove(key);
    }
}

Related

  1. removeDoubleQuotes(Map argMap)
  2. removeElementFromJsonMap(Map toscaJson, String elementName)
  3. removeEmptyArray(Map map)
  4. removeEmptyValues(Map params)
  5. removeExistingItemsFromProvided(Map existingItems, Map providedItems)
  6. removeFromMap( Map map, K key, V value)
  7. removeFromMapValues(final Map map, final Object value)
  8. removeGeneric( List> list)
  9. removeHeader(Map headers, String header)