Java Map Put putMapByPair(String pair, Map m)

Here you can find the source of putMapByPair(String pair, Map m)

Description

put Map By Pair

License

Apache License

Declaration

public static void putMapByPair(String pair, Map m) 

Method Source Code

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

import java.util.Map;

public class Main {
    public static void putMapByPair(String pair, Map m) {
        if (null == pair || "".equals(pair)) {
            return;
        }/*from   w  w  w . j a  va 2 s  .c  o m*/
        int indexOf = pair.indexOf("=");
        if (-1 != indexOf) {
            String k = pair.substring(0, indexOf);
            String v = pair.substring(indexOf + 1, pair.length());
            if (null != k && !"".equals(k)) {
                m.put(k, v);
            }
        } else {
            m.put("pair", "");
        }
    }
}

Related

  1. putLowerNotNull(Map m, String k, V v)
  2. putMap(Map map, Object... args)
  3. putMap(Map target, Map map)
  4. putMapBoolean(Map params, String key)
  5. putMapBooleanList(Map params, String... keys)
  6. putMapEntry(Map map, String name, String value)
  7. putMapNotNullKey(Map map, K key, V value)
  8. putMapValue(String path, Object value, Map map)
  9. putModifiedAttribute(Map aMap, String name, Object value)