org.qi4j.api.association

## Interface Association<T>

- All Superinterfaces:
    AbstractAssociation
  All Known Implementing Classes:
    AssociationWrapper

      public interface Association<T>
      extends AbstractAssociation

  Association to a single EntityComposite.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `get()` Get the associated entity.
    `EntityReference` | `reference()`
    `void` | `set(T associated)` Set the associated entity.

- - ### Method Detail

    - #### get

          T get()

      Get the associated entity.
      Returns:
        the associated entity

    - #### set

          void set(T associated)
                   throws IllegalArgumentException,
                          IllegalStateException

      Set the associated entity.
      Parameters:
        `associated` - the entity
      Throws:
        `IllegalArgumentException` - thrown if the entity is not a valid reference for this association
        `IllegalStateException` - thrown if association is immutable

    - #### reference

          EntityReference reference()

      Returns:
        the the reference of the associated entity.