Java Utililty Methods Map Remove

List of utility methods to do Map Remove

Description

The list of methods to do Map Remove are organized into topic(s).

Method

voidremoveNullPair(Map map)
remove Null Pair
List<Object> nullPairKeyList = new ArrayList<>();
for (Object key : map.keySet()) {
    if ("".equals(key) || map.get(key) == null) {
        nullPairKeyList.add(key);
for (Object nullPairKey : nullPairKeyList) {
    map.remove(nullPairKey);
...
MapremoveNullValues(final Map parameters)
Removes Entries with null as value and returns a new Map
Map<String, String> cleanedParameters = new HashMap<>(parameters.size(), 1);
for (Map.Entry<String, String> entry : parameters.entrySet()) {
    if (entry.getValue() != null) {
        cleanedParameters.put(entry.getKey(), entry.getValue());
return cleanedParameters;
voidremoveNullValues(Map map)
Removes null values from the given map
if (map == null)
    return;
map.values().removeAll(Collections.singleton(null));
MapremoveObject(Map map, T key)
remove Object
if (map == null) {
    map = new HashMap<T, U>();
map.remove(key);
return map;
ObjectremoveObjectProperty(Map properties, String key, Object defaultValue)
Returns an Object property from a Map and removes it.
Object value = defaultValue;
if (properties != null && properties.containsKey(key)) {
    value = properties.remove(key);
return value;
voidremoveOutStringsStrings(Map map, String newString)
Remove um string da tabela de espalhamento caso seja igual ao parametro 'newString'
for (Iterator<Entry<String, String>> iterator = map.entrySet().iterator(); iterator.hasNext();) {
    Map.Entry<String, String> entry = (Map.Entry<String, String>) iterator.next();
    String key = entry.getKey();
    if (key.equals(newString)) {
        iterator.remove();
MapremoveParamsForAlipaySign(Map map)
remove Params For Alipay Sign
map.remove("sign");
map.remove("sign_type");
return map;
MapremoveParentBeans(Map parentBeans, Map beans)
remove Parent Beans
for (String key : parentBeans.keySet()) {
    beans.remove(key);
return beans;
MapremovePrivateColumns(Map contentValues)
removes Key
HashMap<String, Object> result = new HashMap<String, Object>();
Object[] keySet = (contentValues.keySet().toArray());
for (int i = 0; i < keySet.length; i++) {
    String name = (String) keySet[i];
    Object value = contentValues.get(name);
    if (!"Key".equals(name)) {
        result.put(name, value);
return result;
voidremoveRownum(List> rows)
remove Rownum
for (Map<String, Object> row : rows) {
    row.remove("ROWNUM_");