Class RelationshipDef

  • All Implemented Interfaces:
    Serializable

    public class RelationshipDef
    extends TypeDef
    RelationshipDef describes the type of a relationship. A relationships links two entities together. The RelationshipDef defines the types of those entities in the RelationshipEndDefs. It also defines if this relationship allows classifications to propagate through it.
    See Also:
    Serialized Form
    • Constructor Detail

      • RelationshipDef

        public RelationshipDef()
        Minimal constructor builds an empty RelationshipDef
      • RelationshipDef

        public RelationshipDef​(TypeDefCategory category,
                               String guid,
                               String name,
                               long version,
                               String versionName)
        Typical constructor is passed the properties of the typedef's super class being constructed.
        Parameters:
        category - category of this TypeDef
        guid - unique id for the TypeDef
        name - unique name for the TypeDef
        version - active version number for the TypeDef
        versionName - name for the active version of the TypeDef
      • RelationshipDef

        public RelationshipDef​(RelationshipDef templateTypeDef)
        Copy/clone constructor creates a copy of the supplied template.
        Parameters:
        templateTypeDef - template to copy
    • Method Detail

      • cloneFromSubclass

        public TypeDef cloneFromSubclass()
        Delegate the process of cloning to the subclass.
        Specified by:
        cloneFromSubclass in class TypeDef
        Returns:
        subclass of TypeDef
      • getPropagationRule

        public ClassificationPropagationRule getPropagationRule()
        Return the rule that determines if classifications are propagated across this relationship.
        Returns:
        ClassificationPropagationRule Enum
      • setPropagationRule

        public void setPropagationRule​(ClassificationPropagationRule propagationRule)
        Set up the rule that determines if classifications are propagated across this relationship.
        Parameters:
        propagationRule - ClassificationPropagationRule Enum
      • getEndDef1

        public RelationshipEndDef getEndDef1()
        Return the details associated with the first end of the relationship.
        Returns:
        endDef1 RelationshipEndDef
      • setEndDef1

        public void setEndDef1​(RelationshipEndDef endDef1)
        Set up the details associated with the first end of the relationship.
        Parameters:
        endDef1 - RelationshipEndDef
      • getEndDef2

        public RelationshipEndDef getEndDef2()
        Return the details associated with the second end of the relationship.
        Returns:
        endDef2 RelationshipEndDef
      • setEndDef2

        public void setEndDef2​(RelationshipEndDef endDef2)
        Set up the details associated with the second end of the relationship.
        Parameters:
        endDef2 - RelationshipEndDef
      • getMultiLink

        public boolean getMultiLink()
        Return whether multiple relationships of this type are allowed between the same two entities.
        Returns:
        boolean flag
      • setMultiLink

        public void setMultiLink​(boolean multiLink)
        Set up whether multiple relationships of this type are allowed between the same two entities.
        Parameters:
        multiLink - boolean flag
      • toString

        public String toString()
        Standard toString method.
        Overrides:
        toString in class TypeDef
        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 TypeDef
        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 TypeDef
        Returns:
        in hash code