org.qi4j.api.association
Class AssociationWrapper
java.lang.Object
org.qi4j.api.association.AssociationWrapper
- All Implemented Interfaces:
- AbstractAssociation, Association<java.lang.Object>
public class AssociationWrapper
- extends java.lang.Object
- implements Association<java.lang.Object>
If you want to catch getting and setting association, then create a GenericConcern
that wraps the Qi4j-supplied Association instance with AssociationWrappers. Override
get() and/or set() to perform your custom code.
Method Summary |
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
get()
Get the associated entity. |
int |
hashCode()
|
Association<java.lang.Object> |
next()
|
void |
set(java.lang.Object associated)
Set the associated entity. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
next
protected Association<java.lang.Object> next
AssociationWrapper
public AssociationWrapper(Association<java.lang.Object> next)
next
public Association<java.lang.Object> next()
get
public java.lang.Object get()
- Description copied from interface:
Association
- Get the associated entity.
- Specified by:
get
in interface Association<java.lang.Object>
- Returns:
- the associated entity
set
public void set(java.lang.Object associated)
throws java.lang.IllegalArgumentException
- Description copied from interface:
Association
- Set the associated entity.
- Specified by:
set
in interface Association<java.lang.Object>
- Parameters:
associated
- the entity
- Throws:
java.lang.IllegalArgumentException
- thrown if the entity is not a valid reference for this association
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object