Java Map Put putIntoMap(String key, Object value)

Here you can find the source of putIntoMap(String key, Object value)

Description

If the value is equal to {skip} then it will be skipped from adding

License

Apache License

Declaration

public static HashMap<String, Object> putIntoMap(String key, Object value) 

Method Source Code


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

import java.util.HashMap;

public class Main {
    private static HashMap<String, Object> map = new HashMap<String, Object>();

    /**/*  ww  w  .  ja v a2  s .c om*/
     * If the value is equal to {skip} then it will be skipped from adding
     */
    public static HashMap<String, Object> putIntoMap(String key, Object value) {
        if (!value.equals("{skip}")) {
            map.put(key, value);
        }

        return map;
    }
}

Related

  1. putIfNotNull(Map> params, String key, T value)
  2. putIfNotNullAndTrue(Map map, String key, Boolean boolValue)
  3. putIfNull(Map map, Object key, Object defaultValue)
  4. putIfSet(Map config, String key, Object... values)
  5. putIntoMap(Map m, T[] keys, S[] values)
  6. putItem(Map map, Object key, Object value)
  7. putKV(Map map, String k, Object v)
  8. putLong(Map properties, String key, long value)
  9. putLowerNotNull(Map m, String k, V v)