Class RelationshipView

java.lang.Object
com.structurizr.view.RelationshipView
All Implemented Interfaces:
Comparable<RelationshipView>

public final class RelationshipView extends Object implements Comparable<RelationshipView>
This class represents an instance of a Relationship on a View.
  • Method Details

    • getId

      public String getId()
      Gets the ID of the relationship this RelationshipView represents.
      Returns:
      the ID, as a String
    • getRelationship

      public Relationship getRelationship()
      Gets the relationship that this RelationshipView represents.
      Returns:
      a Relationship instance
    • getDescription

      public String getDescription()
      Gets the description of this relationship (used in dynamic views only).
      Returns:
      the description, as a String or an empty string if a description has not been set
    • getUrl

      public String getUrl()
      Gets the URL where more information about this relationship instance can be found.
      Returns:
      a URL as a String
    • setUrl

      public void setUrl(String url)
      Sets the URL where more information about this relationship instance can be found.
      Parameters:
      url - the URL as a String
      Throws:
      IllegalArgumentException - if the URL is not a well-formed URL
    • getOrder

      public String getOrder()
      Gets the order of this relationship (used in dynamic views only; e.g. 1.0, 1.1, 2.0, etc).
      Returns:
      the order, as a String
    • isResponse

      public Boolean isResponse()
      Gets whether this relationship view represents a response (used in dynamic views only).
      Returns:
      true if a response, false or null otherwise
    • getVertices

      public Collection<Vertex> getVertices()
      Gets the set of vertices used to render the relationship.
      Returns:
      a collection of Vertex objects
    • setVertices

      public void setVertices(Collection<Vertex> vertices)
      Sets the collection of vertices used when rendering this relationship.
      Parameters:
      vertices - a Collection of Vertex instances
    • getRouting

      public Routing getRouting()
      Gets the routing algorithm used when rendering this relationship.
      Returns:
      a Routing instance, or null if not explicitly set
    • setRouting

      public void setRouting(Routing routing)
      Sets the routing algorithm used when rendering this relationship.
      Parameters:
      routing - a Routing instance, or null to not explicitly set this property
    • getPosition

      public Integer getPosition()
      Gets the position of the annotation along the line.
      Returns:
      an integer between 0 (start of the line) to 100 (end of the line) inclusive
    • setPosition

      public void setPosition(Integer position)
      Sets the position of the annotation along the line.
      Parameters:
      position - the position, as an integer between 0 (start of the line) to 100 (end of the line) inclusive
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(RelationshipView relationshipView)
      Specified by:
      compareTo in interface Comparable<RelationshipView>