Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param pathString nodes to walk in map
@return value
351586
public static <A, B> Map<A, B> dotGetMapUnsafe(final Map map, final String pathString) {
        return dotGetUnsafe(map, Map.class, pathString);
    }
138339
public static Map<String, AttributeValue> fromSimpleMap(
        Map<String, Object> map) {
        if (map == null)
            return null;
        // row with multiple attributes
        Map<String, AttributeValue> result = new LinkedHashMap<String, AttributeValue>();
        for (Map.Entry<String, Object> entry : map.entrySet())
            result.put(entry.getKey(), toAttributeValue(entry.getValue()));
        return result;
    }
38398
public static <A, B> Map<A, B> getNullableMap(final Map map, final Object... path) {
        return getNullable(map, Map.class, path);
    }
423078
public static <A, B> Map<A, B> getMapUnsafe(final Map map, final Object... path) {
        return getUnsafe(map, Map.class, path);
    }
399221
public static <T> Optional<T> dotGetNullableOptional(
            final Map map, final String pathString, final Class<T> clazz
    ) {
        return dotGetNullable(map, Optional.class, pathString);
    }
272973
public static String getValue(Map<String,String> map, String key, String defaultValue) {
		return map.containsKey( key ) ? map.get( key ) : defaultValue;
	}
1220878
public static String normalizePathMapping(String pathMapping) {

		String normalizedPathMapping = normalizePath(pathMapping);
		if (normalizedPathMapping.endsWith("/**"))
			normalizedPathMapping = normalizedPathMapping.substring(0, normalizedPathMapping.length() - 3);
		return normalizedPathMapping;
	}
903152
static Map<String, String> valueAsMapOfStrings(Map<String, Object> map, Key key, Map<String, String> defaultValue) {
        Map<String, Object> castedDefaultValue = new HashMap<String, Object>();
        castedDefaultValue.putAll(defaultValue);

        Map<String, Object> uncastedResult = valueAsMap(map, key, castedDefaultValue);
        Map<String, String> castedResult = new HashMap<String, String>();
        for (Map.Entry<String, Object> entry : uncastedResult.entrySet()) {
            castedResult.put(entry.getKey(), entry.getValue() == null ? null : entry.getValue().toString());
        }
        return castedResult;
    }
211048
public static Map dotAssoc(final Map map, final String pathString, final Object value) {
        return dotAssoc(map, map.getClass(), pathString, value);
    }
271264
public static <T> List<T> dotGetListUnsafe(final Map map, final String pathString, final Class<T> clazz) {
        return (List<T>) dotGetUnsafe(map, List.class, pathString);
    }
900439
public static Map<String, String> mapStringToMap(String map) {
    String[] m = map.split("[,;]");
    Map<String, String> res = new HashMap<String, String>();
    for (String str : m) {
      int index = str.lastIndexOf('=');
      String key = str.substring(0, index);
      String val = str.substring(index + 1);
      res.put(key.trim(), val.trim());
    }
    return res;
  }
1289716
public static <K, V> Map<K, V> copy(final Map<K, V> map) {
		if (map == null) {
			return null;
		}

		TypeEnum keyType = null;
		TypeEnum valueType = null;

		Map<K, V> copy = new HashMap<K, V>();
		for (Map.Entry<K, V> entry : map.entrySet()) {
			K key = entry.getKey();
			V value = entry.getValue();

			K keyCopy = null;
			if (key != null) {
				if (keyType == null) {
					keyType = TypeEnum.dataTypeOf(key.getClass());
				}
				keyCopy = copy(key, keyType);
			}

			V valueCopy = null;
			if (value != null) {
				if (valueType == null) {
					valueType = TypeEnum.dataTypeOf(value.getClass());
				}
				valueCopy = copy(value, valueType);
			}

			copy.put(keyCopy, valueCopy);
		}

		return copy;
	}
320160
@SuppressWarnings("unchecked")
    public static String map2JsonString(Map<String, Object> map)
    {
        IStringBuffer sb = new IStringBuffer();
        sb.append('{');
        for ( Map.Entry<String, Object> entry : map.entrySet() )
        {
            sb.append('"').append(entry.getKey().toString()).append("\": ");
            
            Object obj = entry.getValue();
            if ( obj instanceof List<?> ) {
                sb.append(list2JsonString((List<Object>)obj)).append(',');
            } else if (obj instanceof Object[]) {
                sb.append(vector2JsonString((Object[])obj)).append(',');
            } else if (obj instanceof Map<?,?>) {
                sb.append(map2JsonString((Map<String, Object>)obj)).append(',');
            } else if ((obj instanceof Boolean) 
                    || (obj instanceof Byte) || (obj instanceof Short) 
                    || (obj instanceof Integer) || (obj instanceof Long) 
                    || (obj instanceof Float) || (obj instanceof Double)) {
                sb.append(obj.toString()).append(',');
            } else {
                String v = obj.toString();
                int last = v.length() - 1;
                
                if ( v.length() > 1 
                        && ( (v.charAt(0) == '{' && v.charAt(last) == '}' )
                                || (v.charAt(0) == '[' && v.charAt(last) == ']' ) ) 
                ) {
                    sb.append(v).append(',');
                } else {
                    sb.append('"').append(v).append("\",");
                }
            }
        }
        if ( sb.length() > 1 ) {
            sb.deleteCharAt(sb.length()-1);
        }
        sb.append('}');
        
        return sb.toString();
    }
155330
public static <A, B> Optional<Map<A, B>> getMap(final Map map, final Object... path) {
        return get(map, Map.class, path).map(m -> (Map<A, B>) m);
    }
1200884
public static <T> T getValue(Map<String, Object> map, String key, Class<T> clazz) {
        return map != null ? ValueUtils.convertValue(map.get(key), clazz) : null;
    }
799084
public static List<Map<String, Object>> nest(String key, Map<String, Object> map) {
        List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
        String patternString = MessageFormat.format("^{0}\\.([0-9]*)\\.(.*)", Pattern.quote(key));
        Pattern pattern = Pattern.compile(patternString);
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            String k = entry.getKey();
            Matcher matcher = pattern.matcher(k);
            if (matcher.matches()) {
                int base = 0;
                processMatch(result, entry.getValue(), matcher, base);
            }
        }
        return result;
    }
1150928
public static <A, B> Map<A, B> dotGetNullableMap(final Map map, final String pathString) {
        return dotGetNullable(map, Map.class, pathString);
    }