Converts {@link NamedNodeMap} to a {@link LinkedHashMap}&lt;String,String&gt;.
@param _nodeMap node map
@return {@link LinkedHashMap}, maybe empty but never null
330351
public static Map<String, String> convertToAttributeMap(NamedNodeMap _nodeMap) {
        Map<String, String> map = new LinkedHashMap<>();
        for (int i = 0; i < _nodeMap.getLength(); i++) {
            Node node = _nodeMap.item(i);
            map.put(node.getNodeName(), node.getNodeValue());
        }
        return map;
    }
135957
protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		type = getValueRecursive(attributes.getNamedItem("xlink:type"));
		xLink = getValueRecursive(attributes.getNamedItem("xmlns:xlink"));
		href = getValueRecursive(attributes.getNamedItem("xlink:href"));
	}
140460
public Map<String, String> getParametersToMap(Map<String, String> map) {
        if (map == null) map = new LinkedHashMap<>();
        final Map<String, String> map0 = map;
        getParameters().forEach((k, v) -> map0.put(k, v));
        return map0;
    }
967448
private void visitMap(final ObjectGraphNode node) {
		Map map = (Map) node.getValue();

		for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
			Map.Entry entry = (Map.Entry) i.next();
			Object key = entry.getKey();

			if (key != null) {
				ObjectGraphNode keyNode = new ObjectGraphNode(++nodeCount, "key", key.getClass().
						getName(), key);
				node.add(keyNode);
				visit(keyNode);
			} else {
				ObjectGraphNode keyNode = new ObjectGraphNode(++nodeCount, "key", Object.class.
						getName(), null);
				node.add(keyNode);
			}

			Object value = entry.getValue();

			if (value != null) {
				ObjectGraphNode valueNode = new ObjectGraphNode(++nodeCount, "value", value.
						getClass().getName(), value);
				node.add(valueNode);
				visit(valueNode);
			} else {
				ObjectGraphNode valueNode = new ObjectGraphNode(++nodeCount, "value", Object.class.
						getName(), null);
				node.add(valueNode);
			}
		}

		adjustOverhead(node);
	}
695103
private static void getNamespaceBindings(Element element, Map<String, String> namespaceMap) {
    if (element == null) {
      return;
    }
    NamedNodeMap attrs = element.getAttributes();
    for (int i = 0; i < attrs.getLength(); i++) {
      Node node = attrs.item(i);
      String name = node.getNodeName();
      if ((name != null && (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith(XMLConstants.XMLNS_ATTRIBUTE + ":")))) {
        namespaceMap.put(name, node.getNodeValue());
      }
    }
    Node parent = element.getParentNode();
    if (parent instanceof Element) {
      getNamespaceBindings((Element) parent, namespaceMap);
    }
  }
1279921
@SuppressWarnings("unchecked")
  public static <K, V> MultiValueMap<K, V> unmodifiableMultiValueMap(
      final MultiValueMap<? extends K, ? extends V> map) {
    Assert.notNull(map, "'map' must not be null");
    final Map<K, List<V>> result = new LinkedHashMap<>(map.size());
    map.forEach((key, value) -> {
      final List<? extends V> values = Collections.unmodifiableList(value);
      result.put(key, (List<V>) values);
    });
    final Map<K, List<V>> unmodifiableMap = Collections.unmodifiableMap(result);
    return CollectionUtils.toMultiValueMap(unmodifiableMap);
  }
809002
@Override
	public Map<String, Object> parseMap(InputStream source) {
		Map<String, Object> map = new LinkedHashMap<>();

		try (ParserWrapper parserWrapper = createParser(source)) {
			Map<String, Object> result = BindMapHelper.parseMap(this, parserWrapper, map);
			return result;
		} catch (Exception e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
556205
@Deprecated
	public static <K,V> Map<K,V> createLinkedMapIfPossible(int initialCapacity) {
		return new LinkedHashMap<K,V>(initialCapacity);
	}
1363579
private ImmutableNode mapToNode(final Builder builder, final Map<String, Object> map) {
        for (final Map.Entry<String, Object> entry : map.entrySet()) {
            final String key = entry.getKey();
            final Object value = entry.getValue();
            if (value instanceof List) {
                // For a list, add each list item as a child of this node.
                for (final Object item : (List)value) {
                    addChildNode(builder, key, item);
                }
            } else {
                // Otherwise, add the value as a child of this node.
                addChildNode(builder, key, value);
            }
        }
        return builder.create();
    }
1197962
@SuppressWarnings({"rawtypes"})
    private Map.Entry getMapEntry(XmlNode node) {
        String keyName = node.getName();
        Object value = null;
        XmlMapEntry xmlMapEntry = this.mapSpecification.get(keyName);
        switch (node.getType()) {
            case XmlNode.ATTRIBUTE_NODE:
                value = node.getValue();
                break;
            case XmlNode.ELEMENT_NODE: {
                if (xmlMapEntry == null) {
                    value = new XmlNodeArray(node.getChildren());
                } else {
                    XmlMapFacet valueFacet = xmlMapEntry.getValue();
                    switch (valueFacet.getType()) {
                        case ELEMENT:
                            value = keyName;
                            break;
                        case CONTENT: {
                            List<XmlNode> nodeList = node.getChildren();
                            if (nodeList.size() > 0) {
                                value = new XmlNodeArray(nodeList);
                            }
                        }
                            break;
                        case ATTRIBUTE: {
                            Map<String, XmlNode> attributes = node.getAttributes();
                            XmlNode attribute = attributes.get(valueFacet.getName());
                            if (attribute != null) {
                                value = attribute.getValue();
                            } else {
                            }
                        }
                            break;
                        default:
                            throw new IllegalStateException();
                    }
                    XmlMapFacet keyFacet = xmlMapEntry.getKey();
                    switch (keyFacet.getType()) {
                        case ELEMENT:
                            // keyName is already set
                            break;
                        case CONTENT: {
                            List<XmlNode> nodeList = node.getChildren();
                            if (nodeList.size() > 0) {
                                keyName = getStringValue((XmlNode) nodeList.get(0));
                            } else {
                                keyName = null;
                            }
                        }
                            break;
                        case ATTRIBUTE: {
                            Map<String, XmlNode> attributes = node.getAttributes();
                            XmlNode attribute = attributes.get(keyFacet.getName());
                            if (attribute != null) {
                                keyName = attribute.getValue();
                            } else {
                                keyName = null;
                            }
                            break;
                        }
                        default:
                            throw new IllegalStateException();
                    }
                }
            }
        }
        if (keyName == null) {
            return null;
        } else {
            final Object _key = keyName;
            final Object _value = value;
            return new Map.Entry() {

                @Override
                public Object getKey() {
                    return _key;
                }

                @Override
                public Object getValue() {
                    return _value;
                }

                @Override
                public Object setValue(Object object) {
                    return null;
                }

            };
        }
    }
583039
Map<String, UserData> getUserDataMap(NodeImpl node) {
        if (nodeToUserData == null) {
            nodeToUserData = new WeakHashMap<NodeImpl, Map<String, UserData>>();
        }
        Map<String, UserData> userDataMap = nodeToUserData.get(node);
        if (userDataMap == null) {
            userDataMap = new HashMap<String, UserData>();
            nodeToUserData.put(node, userDataMap);
        }
        return userDataMap;
    }
317305
protected Object createNode(Object name, Map attributes) {
        return createNode(name, attributes, null);
    }
1250349
public static Map<String, String> transformMap(final Map<String, Object> paramMap) {
        final Map<String, String> paramStrMap = new LinkedHashMap<String, String>();
        for (final Map.Entry<String, Object> entry : paramMap.entrySet()) {
            paramStrMap.put(entry.getKey(), entry.getValue().toString());
        }

        return paramStrMap;
    }
1135015
public static <K, E> Set<E> getAndPutLinkedHashSetIfAbsent(final Map<K, Set<E>> map, final K key) {
        Set<E> v = map.get(key);

        if (v == null) {
            v = new LinkedHashSet<>();
            v = map.put(key, v);
        }

        return v;
    }
346536
private Map<String, Object> flatten(Map<String, Object> map) {
		Map<String, Object> result = new LinkedHashMap<>();
		flatten(null, result, map);
		return result;
	}
368149
@SuppressWarnings("checkstyle:innerassignment")
    private static IPath[] decodePatterns(NamedNodeMap nodeMap, String tag) {
        final String sequence = removeAttribute(tag, nodeMap);
        if (!"".equals(sequence)) { //$NON-NLS-1$
            final char[][] patterns = CharOperation.splitOn('|', sequence.toCharArray());
            final int patternCount;
            if ((patternCount = patterns.length) > 0) {
                IPath[] paths = new IPath[patternCount];
                int index = 0;
                for (int j = 0; j < patternCount; j++) {
                    final char[] pattern = patterns[j];
                    if (pattern.length == 0) {
                        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=105581
                        continue;
                    }
                    paths[index++] = new Path(new String(pattern));
                }
                if (index < patternCount) {
                    System.arraycopy(paths, 0, paths = new IPath[index], 0, index);
                }
                return paths;
            }
        }
        return null;
    }
858447
static Map<String, Object> simplePayload(final String name) {
		if (name == null) {
			return null;
		}
		Map<String, Object> payload = new LinkedHashMap<>();
		payload.put("message", MSG_PREFIX + name);
		return payload;
	}