Package: groovy.util

## [Java] Class Expando

- groovy.util.Expando

-     public class Expando
      extends GroovyObjectSupport

  Represents a dynamically expandable bean.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `Expando()` Creates an empty expando.
    `Expando(Map expandoProperties)` Creates an expando backed by the supplied properties.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected Map` | `createMap()` Factory method to create a new Map used to store the expando properties map
    `` | `public boolean` | `equals(Object obj)` This allows equals to be overridden by a closure field method attached to the expando object.
    `` | `public List` | `getMetaPropertyValues()` Returns meta-properties representing the current dynamic properties.
    `` | `public Map` | `getProperties()` Returns: the dynamically expanded properties
    `` | `public Object` | `getProperty(String property)` Resolves a property from the dynamic property map before normal lookup.
    `` | `public int` | `hashCode()` This allows hashCode to be overridden by a closure field method attached to the expando object.
    `` | `public Object` | `invokeMethod(String name, Object args)` Invokes a declared method or a closure stored as a dynamic property.
    `` | `public void` | `setProperty(String property, Object newValue)` Stores a dynamic property.
    `` | `public String` | `toString()` This allows toString to be overridden by a closure field method attached to the expando object.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Constructor Detail

    - #### public Expando()

      Creates an empty expando.

    - #### public Expando(Map expandoProperties)

      Creates an expando backed by the supplied properties.

      Parameters:
        `expandoProperties` - the initial properties map

  - ### Method Detail

    - #### protected Map createMap()

      Factory method to create a new Map used to store the expando properties map

      Returns:
        a newly created Map implementation

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

      This allows equals to be overridden by a closure field method attached to the expando object.

      See Also:
        Object.equals

    - #### public List getMetaPropertyValues()

      Returns meta-properties representing the current dynamic properties.

      Returns:
        the meta-property values

    - #### public Map getProperties()

      Returns:
        the dynamically expanded properties

    - #### public Object getProperty(String property)

      Resolves a property from the dynamic property map before normal lookup.

      Parameters:
        `property` - the property name
      Returns:
        the property value, or `null` if it is not defined

    - #### public int hashCode()

      This allows hashCode to be overridden by a closure field method attached to the expando object.

      See Also:
        Object.hashCode

    - #### public Object invokeMethod(String name, Object args)

      Invokes a declared method or a closure stored as a dynamic property.

      Parameters:
        `name` - the method name
        `args` - the invocation arguments
      Returns:
        the invocation result

    - #### public void setProperty(String property, Object newValue)

      Stores a dynamic property.

      Parameters:
        `property` - the property name
        `newValue` - the property value

    - #### public String toString()

      This allows toString to be overridden by a closure field method attached to the expando object.

      See Also:
        Object.toString