Package: org.codehaus.groovy.runtime.wrappers

## [Java] Class Wrapper

- org.codehaus.groovy.runtime.wrappers.Wrapper

- All Implemented Interfaces and Traits:
    GroovyObject

      public abstract class Wrapper
      extends Object
      implements GroovyObject

  Base class for runtime wrappers that expose a value through GroovyObject while reporting a constrained type.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected Class` | `constrainedType` | The constrained type the wrapped value should present to the runtime.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Wrapper(Class constrainedType)` Creates a wrapper for values that should appear as the supplied type.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected abstract MetaClass` | `getDelegatedMetaClass()` Returns the meta class that should handle GroovyObject operations for the wrapped value.
    `` | `public MetaClass` | `getMetaClass()` Returns the MetaClass used to service GroovyObject operations for the wrapped value.
    `` | `public Class` | `getType()` Returns the constrained type associated with this wrapper.
    `` | `protected abstract Object` | `getWrapped()` Returns the object used as the delegation target for meta-class-based operations.
    `` | `public abstract Object` | `unwrap()` Returns the wrapped value.

  - ### Inherited Methods Summary

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

- - ### Field Detail

    - #### protected final Class constrainedType

      The constrained type the wrapped value should present to the runtime.

  - ### Constructor Detail

    - #### public Wrapper(Class constrainedType)

      Creates a wrapper for values that should appear as the supplied type.

      Parameters:
        `constrainedType` - the type the wrapped value should report

  - ### Method Detail

    - #### protected abstract MetaClass getDelegatedMetaClass()

      Returns the meta class that should handle GroovyObject operations for the wrapped value.

      Returns:
        the delegated meta class

    - #### public MetaClass getMetaClass()

      Returns the MetaClass used to service GroovyObject operations for the wrapped value.

      Returns:
        the delegated meta class

    - #### public Class getType()

      Returns the constrained type associated with this wrapper.

      Returns:
        the type the wrapped value should be treated as

    - #### protected abstract Object getWrapped()

      Returns the object used as the delegation target for meta-class-based operations.

      Returns:
        the underlying wrapped object

    - #### public abstract Object unwrap()

      Returns the wrapped value.

      Returns:
        the underlying value represented by this wrapper