Class AssociationRef
- java.lang.Object
-
- org.alfresco.service.cmr.repository.AssociationRef
-
- All Implemented Interfaces:
java.io.Serializable
,EntityRef
@AlfrescoPublicApi public class AssociationRef extends java.lang.Object implements EntityRef, java.io.Serializable
This class represents a regular, named node relationship between two nodes.Note that the ID of the association might not be populated.
- Author:
- Derek Hulley
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description 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)
AssociationRef(NodeRef sourceRef, QName assocTypeQName, NodeRef targetRef)
Construct a representation of a source --- name ----> target relationship.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
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 associationint
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
AssociationRef
public AssociationRef(NodeRef sourceRef, QName assocTypeQName, NodeRef targetRef)
Construct a representation of a source --- name ----> target relationship.- Parameters:
sourceRef
- the source reference - never nullassocTypeQName
- the qualified name of the association type - never nulltargetRef
- the target node reference - never null.
-
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 - may be nullsourceRef
- the source reference - never nullassocTypeQName
- the qualified name of the association type - never nulltargetRef
- the target node reference - never null.
-
AssociationRef
public AssociationRef(java.lang.String assocRefStr)
- Parameters:
assocRefStr
- a string of the form id|sourceNodeRef|targetNodeRef|assocTypeQName.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getId
public java.lang.Long getId()
Gets the unique identifier for this association.- Returns:
- the unique identifier for this association, or null if the ID was not given at the time of construction
-
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
-
-