Class DataContractRelationship

java.lang.Object
org.odpi.openmetadata.frameworks.integration.bitol.odcs.DataContractRelationship

public class DataContractRelationship extends Object
This class represents a relationship (typically a foreign key) between schema elements in an Open Data Contract Standard (ODCS) data contract. At the schema object level both the "from" and "to" references are supplied. At the property level the "from" is implicit (the property itself) and only the "to" reference is supplied. Each reference is either a shorthand reference (object.property) or a fully qualified reference (contractId.object.property). The standard allows a single reference or a list of references (for composite keys); this bean always holds a list.
  • Constructor Details

    • DataContractRelationship

      public DataContractRelationship()
      Default constructor
  • Method Details

    • getType

      public String getType()
      Return the type of relationship. The only standard value is foreignKey.
      Returns:
      string type name
    • setType

      public void setType(String type)
      Set up the type of relationship. The only standard value is foreignKey.
      Parameters:
      type - string type name
    • getFrom

      public List<String> getFrom()
      Return the source property reference(s) of the relationship.
      Returns:
      list of property references
    • setFrom

      public void setFrom(List<String> from)
      Set up the source property reference(s) of the relationship.
      Parameters:
      from - list of property references
    • getTo

      public List<String> getTo()
      Return the target property reference(s) of the relationship.
      Returns:
      list of property references
    • setTo

      public void setTo(List<String> to)
      Set up the target property reference(s) of the relationship.
      Parameters:
      to - list of property references
    • getCustomProperties

      public List<BitolCustomProperty> getCustomProperties()
      Return the list of custom (key/value) properties attached to this element.
      Returns:
      list of custom properties
    • setCustomProperties

      public void setCustomProperties(List<BitolCustomProperty> customProperties)
      Set up the list of custom (key/value) properties attached to this element.
      Parameters:
      customProperties - list of custom properties
    • getId

      public String getId()
      Return the stable identifier of the relationship.
      Returns:
      String
    • setId

      public void setId(String id)
      Set up the stable identifier of the relationship.
      Parameters:
      id - String
    • toString

      public String toString()
      Standard toString method.
      Overrides:
      toString in class Object
      Returns:
      print out of variables in a JSON-style
    • equals

      public boolean equals(Object objectToCompare)
      Compare the values of the supplied object with those stored in the current object.
      Overrides:
      equals in class Object
      Parameters:
      objectToCompare - supplied object
      Returns:
      boolean result of comparison
    • hashCode

      public int hashCode()
      Return hash code based on properties.
      Overrides:
      hashCode in class Object
      Returns:
      int