Class 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
    • 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:
        toString in class InstanceHeader
        Returns:
        JSON style description of variables.
      • equals

        public boolean equals​(Object objectToCompare)
        Validate that an object is equal depending on their stored values.
        Overrides:
        equals in class InstanceHeader
        Parameters:
        objectToCompare - object
        Returns:
        boolean result
      • hashCode

        public int hashCode()
        Return a hash code based on the values of this object.
        Overrides:
        hashCode in class InstanceHeader
        Returns:
        in hash code