Here you can find the source of removeValue(final Map map, final Object key, final Object value)
Parameter | Description |
---|---|
map | the map. |
key | the key. |
value | the value to be removed from the list. |
static void removeValue(final Map map, final Object key, final Object value)
//package com.java2s; import java.util.List; import java.util.Map; public class Main { /**/*from w ww . j a v a2s.c om*/ * remove a value from a value list in a Map. * * @param map * the map. * @param key * the key. * @param value * the value to be removed from the list. */ static void removeValue(final Map map, final Object key, final Object value) { List values; if ((values = (List) map.get(key)) == null) { return; } values.remove(value); if (!values.isEmpty()) { map.put(key, values); } else { map.remove(key); } } }