org.alfresco.service.cmr.repository
Class AssociationRef

java.lang.Object
  extended by org.alfresco.service.cmr.repository.AssociationRef
All Implemented Interfaces:
java.io.Serializable, EntityRef

public class AssociationRef
extends java.lang.Object
implements EntityRef, java.io.Serializable

This class represents a regular, named node relationship between two nodes.

See Also:
Serialized Form

Constructor Summary
AssociationRef(java.lang.Long id, NodeRef sourceRef, QName assocTypeQName, NodeRef targetRef)
          Construct a representation of a source --- name ----> target relationship.
AssociationRef(java.lang.String assocRefStr)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares: AssociationRef.id AssociationRef.sourceRef AssociationRef.targetRef AssociationRef.assocTypeQName
 java.lang.Long getId()
          Gets the unique identifier for this association.
 NodeRef getSourceRef()
           
 NodeRef getTargetRef()
           
 QName getTypeQName()
          Get the qualified name of the source-target association
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssociationRef

public AssociationRef(java.lang.Long id,
                      NodeRef sourceRef,
                      QName assocTypeQName,
                      NodeRef targetRef)
Construct a representation of a source --- name ----> target relationship.

Parameters:
id - unique identifier
sourceRef - the source reference - never null
assocTypeQName - the qualified name of the association type - never null
targetRef - the target node reference - never null.

AssociationRef

public AssociationRef(java.lang.String assocRefStr)
Parameters:
childAssocRefStr - a string of the form id|sourceNodeRef|targetNodeRef|assocTypeQName.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns a string of the form sourceNodeRef|targetNodeRef|assocTypeQName|assocQName

equals

public boolean equals(java.lang.Object o)
Compares:

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getId

public java.lang.Long getId()
Gets the unique identifier for this association.

Returns:
the unique identifier for this association

getTypeQName

public QName getTypeQName()
Get the qualified name of the source-target association

Returns:
Returns the qualified name of the source-target association.

getTargetRef

public NodeRef getTargetRef()
Returns:
Returns the child node reference - never null

getSourceRef

public NodeRef getSourceRef()
Returns:
Returns the parent node reference, which may be null if this represents the imaginary reference to the root node


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.