Class CodeElement

java.lang.Object
com.structurizr.model.CodeElement

public final class CodeElement extends Object
Represents a code element, such as a Java class or interface, that is part of the implementation of a component.
  • Method Details

    • getRole

      public CodeElementRole getRole()
      Gets the role of this code element; Primary or Supporting.
      Returns:
      a CodeElementRole enum
    • getName

      public String getName()
      Gets the name of this code element.
      Returns:
      the name, as a String
    • getType

      public String getType()
      Gets the type (fully qualified type name) of this code element.
      Returns:
      the type, as a String
    • getPackage

      public String getPackage()
      Gets the Java package of this component (i.e. the package of the primary code element).
      Returns:
      the package name, as a String
    • getDescription

      public String getDescription()
      Gets the description of this code element.
      Returns:
      the description, as a String
    • setDescription

      public void setDescription(String description)
      Sets the description of this code element.
      Parameters:
      description - the description, as a String
    • getUrl

      public String getUrl()
      Gets the URL where more information about this code element can be found.
      Returns:
      the URL as a String, or null if not set
    • setUrl

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

      public String getLanguage()
      Gets the programming language of this code element.
      Returns:
      the programming language, as a String
    • setLanguage

      public void setLanguage(String language)
      Sets the programming language of this code element.
      Parameters:
      language - the programming language, as a String
    • getCategory

      public String getCategory()
      Gets the category of this code element (interface, class, etc).
      Returns:
      the category, as a String
    • setCategory

      public void setCategory(String category)
      Sets the category of this code element.
      Parameters:
      category - the category, as a String
    • getVisibility

      public String getVisibility()
      Gets the visibility of this code element (public, package, etc).
      Returns:
      the visibility, as a String
    • setVisibility

      public void setVisibility(String visibility)
      Sets the visibility of this code element.
      Parameters:
      visibility - the visibility, as a String
    • getSize

      public long getSize()
      Gets the size of this code element (e.g. the number of lines of code).
      Returns:
      the size, as a long
    • setSize

      public void setSize(long size)
      Sets the size of this code element.
      Parameters:
      size - the size, as a long
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object