org.qi4j.api.association

## Class AssociationWrapper

- java.lang.Object
- - org.qi4j.api.association.AssociationWrapper

- All Implemented Interfaces:
    AbstractAssociation, Association<Object>

      public class AssociationWrapper
      extends Object
      implements Association<Object>

  If you want to catch getting and setting association, then create a GenericConcern that wraps the Zest-supplied Association instance with AssociationWrappers. Override get() and/or set() to perform your custom code.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Association<Object>` | `next`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AssociationWrapper(Association<Object> next)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `Object` | `get()` Get the associated entity.
    `int` | `hashCode()`
    `Association<Object>` | `next()`
    `EntityReference` | `reference()`
    `void` | `set(Object associated)` Set the associated entity.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### next

          protected Association<Object> next

  - ### Constructor Detail

    - #### AssociationWrapper

          public AssociationWrapper(Association<Object> next)

  - ### Method Detail

    - #### next

          public Association<Object> next()

    - #### get

          public Object get()

      Description copied from interface: `Association`
      Get the associated entity.
      Specified by:
        `get` in interface `Association<Object>`
      Returns:
        the associated entity

    - #### set

          public void set(Object associated)
                   throws IllegalArgumentException

      Description copied from interface: `Association`
      Set the associated entity.
      Specified by:
        `set` in interface `Association<Object>`
      Parameters:
        `associated` - the entity
      Throws:
        `IllegalArgumentException` - thrown if the entity is not a valid reference for this association

    - #### reference

          public EntityReference reference()

      Specified by:
        `reference` in interface `Association<Object>`
      Returns:
        the the reference of the associated entity.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`