Package: org.codehaus.groovy.ast

## [Java] Interface NodeMetaDataHandler

- An interface to mark a node being able to handle metadata.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `copyNodeMetaData(NodeMetaDataHandler other)` Copies all node meta data from the other node to this one
    `` | `Map<?, ?>` | `getMetaDataMap()`
    `` | `T` | `getNodeMetaData(Object key)` Gets the node meta data.
    `` | `T` | `getNodeMetaData(Object key, Function<?, ? extends T> valFn)` Gets the node meta data.
    `` | `Map<?, ?>` | `getNodeMetaData()` Returns an unmodifiable view of the current node metadata.
    `` | `Object` | `putNodeMetaData(Object key, Object value)` Sets the node meta data but allows overwriting values.
    `` | `void` | `removeNodeMetaData(Object key)` Removes a node meta data entry.
    `` | `void` | `setMetaDataMap(Map<?, ?> metaDataMap)`
    `` | `void` | `setNodeMetaData(Object key, Object value)` Sets the node meta data.

- - ### Method Detail

    - #### public void copyNodeMetaData(NodeMetaDataHandler other)

      Copies all node meta data from the other node to this one

      Parameters:
        `other` - the other node

    - #### public Map<?, ?> getMetaDataMap()

    - #### public T getNodeMetaData(Object key)

      Gets the node meta data.

      Parameters:
        `key` - the meta data key
      Returns:
        the node meta data value for this key

    - #### public T getNodeMetaData(Object key, Function<?, ? extends T> valFn)

      Gets the node meta data.

      Parameters:
        `key` - the meta data key
        `valFn` - the meta data value supplier
      Returns:
        the node meta data value for this key

    - #### public Map<?, ?> getNodeMetaData()

      Returns an unmodifiable view of the current node metadata.

      Returns:
        the node metadata. Always not null.

    - #### public Object putNodeMetaData(Object key, Object value)

      Sets the node meta data but allows overwriting values.

      throws:
        GroovyBugError if key is null
      Parameters:
        `key` - the meta data key
        `value` - the meta data value
      Returns:
        the old node meta data value for this key

    - #### public void removeNodeMetaData(Object key)

      Removes a node meta data entry.

      throws:
        GroovyBugError if the key is null
      Parameters:
        `key` - the meta data key

    - #### public void setMetaDataMap(Map<?, ?> metaDataMap)

    - #### public void setNodeMetaData(Object key, Object value)

      Sets the node meta data.

      throws:
        GroovyBugError if key is null or there is already meta data under that key
      Parameters:
        `key` - the meta data key
        `value` - the meta data value