Package: groovy.lang

## [Java] Class NamedValue<T>

- groovy.lang.NamedValue

- All Implemented Interfaces and Traits:
    Serializable

      @Incubating
      public class NamedValue<T>
      extends Object
      implements Serializable

  Represents a value with name

  Type Parameters:
    `T` - the value type
  Since:
    4.0.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `NamedValue(String name, T val)` Creates a named value pair.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `equals(Object o)` {@inheritDoc}
    `` | `public String` | `getName()` Returns the name.
    `` | `public T` | `getVal()` Returns the value.
    `` | `public int` | `hashCode()` {@inheritDoc}
    `` | `public String` | `toString()` {@inheritDoc}
    `` | `public String` | `toString(Map<String, Object> options)` Returns the formatted `name=value` representation using the supplied formatting options.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public NamedValue(String name, T val)

      Creates a named value pair.

      Parameters:
        `name` - the name
        `val` - the value

  - ### Method Detail

    - #### public boolean equals(Object o)

      {@inheritDoc}

    - #### public String getName()

      Returns the name.

      Returns:
        the name

    - #### public T getVal()

      Returns the value.

      Returns:
        the value

    - #### public int hashCode()

      {@inheritDoc}

    - #### public String toString()

      {@inheritDoc}

    - #### public String toString(Map<String, Object> options)

      Returns the formatted `name=value` representation using the supplied formatting options.

      Parameters:
        `options` - the formatting options to apply to the value
      Returns:
        the formatted named value