Package: groovy.xml.slurpersupport

## [Java] Class NamespaceAwareHashMap

- groovy.xml.slurpersupport.NamespaceAwareHashMap

-     public class NamespaceAwareHashMap
      extends HashMap

  Attribute map that resolves namespace-prefixed keys into QName-style names on demand.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `containsKey(Object key)` Returns `true` if this map contains a mapping for the specified key. Parameters: `key` - The key whose presence in this map is to be tested Returns: `true` if this map contains a mapping for the specified key.
    `` | `public String` | `get(Object key)` Returns the value to which the specified key is mapped, or `null` if this map contains no mapping for the key. More formally, if this map contains a mapping from a key `k` to a value `v` such that `(key==null ? k==null : key.equals(k))`, then this method returns `v`; otherwise it returns `null`. (There can be at most one such mapping.) A return value of `null` does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to `null`. The containsKey operation may be used to distinguish these two cases. See Also: put(Object, Object)
    `` | `public Map` | `getNamespaceTagHints()` Returns the prefix hints used for key normalization.
    `` | `public String` | `put(String key, String value)` Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced. Parameters: `key` - key with which the specified value is to be associated `value` - value to be associated with the specified key Returns: the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`.)
    `` | `public void` | `putAll(Map<? extends String, ? extends String> m)` Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map. throws: NullPointerException if the specified map is null Parameters: `m` - mappings to be stored in this map
    `` | `public String` | `remove(Object key)` Removes the mapping for the specified key from this map if present. Parameters: `key` - key whose mapping is to be removed from the map Returns: the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`.)
    `` | `public void` | `setNamespaceTagHints(Map namespaceTagHints)` Sets the prefix-to-namespace hints used to normalize prefixed keys.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class HashMap` | `clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getClass, getOrDefault, hashCode, isEmpty, keySet, merge, notify, notifyAll, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, toString, values, wait, wait, wait`

- - ### Method Detail

    - #### public boolean containsKey(Object key)

      Returns `true` if this map contains a mapping for the specified key.

      Parameters:
        `key` - The key whose presence in this map is to be tested
      Returns:
        `true` if this map contains a mapping for the specified key.

    - #### public String get(Object key)

      Returns the value to which the specified key is mapped, or `null` if this map contains no mapping for the key.

      More formally, if this map contains a mapping from a key `k` to a value `v` such that `(key==null ? k==null : key.equals(k))`, then this method returns `v`; otherwise it returns `null`. (There can be at most one such mapping.)

      A return value of `null` does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to `null`. The containsKey operation may be used to distinguish these two cases.

      See Also:
        put(Object, Object)

    - #### public Map getNamespaceTagHints()

      Returns the prefix hints used for key normalization.

      Returns:
        namespace prefix hints

    - #### public String put(String key, String value)

      Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

      Parameters:
        `key` - key with which the specified value is to be associated
        `value` - value to be associated with the specified key
      Returns:
        the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`.)

    - #### public void putAll(Map<? extends String, ? extends String> m)

      Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.

      throws:
        NullPointerException if the specified map is null
      Parameters:
        `m` - mappings to be stored in this map

    - #### public String remove(Object key)

      Removes the mapping for the specified key from this map if present.

      Parameters:
        `key` - key whose mapping is to be removed from the map
      Returns:
        the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`.)

    - #### public void setNamespaceTagHints(Map namespaceTagHints)

      Sets the prefix-to-namespace hints used to normalize prefixed keys.

      Parameters:
        `namespaceTagHints` - known namespace prefix mappings