Class Relationship
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceElementHeader
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader
-
- org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship
-
- All Implemented Interfaces:
Serializable
public class Relationship extends InstanceHeader
Relationship is a POJO that manages the properties of an open metadata relationship. This includes information about the relationship type, the two entities it connects and the properties it holds.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader
CURRENT_AUDIT_HEADER_VERSION
-
-
Constructor Summary
Constructors Constructor Description Relationship()Default constructor creates an empty relationship linked to nothing.Relationship(Relationship templateElement)Copy/clone constructor builds a relationship from the supplied template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object objectToCompare)Validate that an object is equal depending on their stored values.EntityProxygetEntityOneProxy()Return details of the entity at the first end of the relationship.EntityProxygetEntityTwoProxy()Return details of the entity at second end of the relationship.InstancePropertiesgetProperties()Return a copy of all of the properties for this relationship.inthashCode()Return a hash code based on the values of this object.booleanrelatedToEntity(String entityGUID)Test to determine if the supplied entity is linked by this relationship.StringreturnLinkedEntity(String entityGUID)Return the GUID at the other end of the relationship to the supplied entity.voidsetEntityOneProxy(EntityProxy entityOneProxy)Set up details of the entity at the first end of the relationship.voidsetEntityTwoProxy(EntityProxy entityTwoProxy)Set up the identity of the proxy at the other end of the relationship.voidsetProperties(InstanceProperties newProperties)Set up the properties for this relationship.StringtoString()Standard toString method.-
Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader
getGUID, getInstanceURL, getReIdentifiedFromGUID, setGUID, setInstanceURL, setReIdentifiedFromGUID
-
Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader
getCreatedBy, getCreateTime, getHeaderVersion, getInstanceLicense, getInstanceProvenanceType, getMaintainedBy, getMappingProperties, getMetadataCollectionId, getMetadataCollectionName, getReplicatedBy, getStatus, getStatusOnDelete, getType, getUpdatedBy, getUpdateTime, getVersion, setCreatedBy, setCreateTime, setHeaderVersion, setInstanceLicense, setInstanceProvenanceType, setMaintainedBy, setMappingProperties, setMetadataCollectionId, setMetadataCollectionName, setReplicatedBy, setStatus, setStatusOnDelete, setType, setUpdatedBy, setUpdateTime, setVersion
-
-
-
-
Constructor Detail
-
Relationship
public Relationship()
Default constructor creates an empty relationship linked to nothing.
-
Relationship
public Relationship(Relationship templateElement)
Copy/clone constructor builds a relationship from the supplied template.- Parameters:
templateElement- template relationship to copy
-
-
Method Detail
-
relatedToEntity
public boolean relatedToEntity(String entityGUID)
Test to determine if the supplied entity is linked by this relationship.- Parameters:
entityGUID- unique identifier for the entity to test.- Returns:
- boolean indicate whether the supplied entity is linked by this relationship
-
returnLinkedEntity
public String returnLinkedEntity(String entityGUID)
Return the GUID at the other end of the relationship to the supplied entity.- Parameters:
entityGUID- unique identifier for the entity to test.- Returns:
- String guid for the entity at the other end of the relationship. Null if no matching entity found.
-
getProperties
public InstanceProperties getProperties()
Return a copy of all of the properties for this relationship. Null means no properties exist.- Returns:
- InstanceProperties
-
setProperties
public void setProperties(InstanceProperties newProperties)
Set up the properties for this relationship.- Parameters:
newProperties- InstanceProperties object
-
getEntityOneProxy
public EntityProxy getEntityOneProxy()
Return details of the entity at the first end of the relationship.- Returns:
- entityOneProxy EntityProxy object for the first end of the relationship.
-
setEntityOneProxy
public void setEntityOneProxy(EntityProxy entityOneProxy)
Set up details of the entity at the first end of the relationship.- Parameters:
entityOneProxy- EntityProxy object for the first end of the relationship.
-
getEntityTwoProxy
public EntityProxy getEntityTwoProxy()
Return details of the entity at second end of the relationship.- Returns:
- EntityProxy object for the second end of the relationship
-
setEntityTwoProxy
public void setEntityTwoProxy(EntityProxy entityTwoProxy)
Set up the identity of the proxy at the other end of the relationship.- Parameters:
entityTwoProxy- EntityProxy
-
toString
public String toString()
Standard toString method.- Overrides:
toStringin classInstanceHeader- Returns:
- JSON style description of variables.
-
equals
public boolean equals(Object objectToCompare)
Validate that an object is equal depending on their stored values.- Overrides:
equalsin classInstanceHeader- Parameters:
objectToCompare- object- Returns:
- boolean result
-
hashCode
public int hashCode()
Return a hash code based on the values of this object.- Overrides:
hashCodein classInstanceHeader- Returns:
- in hash code
-
-