Package com.structurizr.model
Class CodeElement
java.lang.Object
com.structurizr.model.CodeElement
public final class CodeElement
extends java.lang.Object
Represents a code element, such as a Java class or interface,
that is part of the implementation of a component.
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getCategory()
Gets the category of this code element (interface, class, etc).java.lang.String
getDescription()
Gets the description of this code element.java.lang.String
getLanguage()
Gets the programming language of this code element.java.lang.String
getName()
Gets the name of this code element.java.lang.String
getPackage()
Gets the Java package of this component (i.e.CodeElementRole
getRole()
Gets the role of this code element; Primary or Supporting.long
getSize()
Gets the size of this code element (e.g.java.lang.String
getType()
Gets the type (fully qualified type name) of this code element.java.lang.String
getUrl()
Gets the URL where more information about this code element can be found.java.lang.String
getVisibility()
Gets the visibility of this code element (public, package, etc).int
hashCode()
void
setCategory(java.lang.String category)
Sets the category of this code element.void
setDescription(java.lang.String description)
Sets the description of this code element.void
setLanguage(java.lang.String language)
Sets the programming language of this code element.void
setSize(long size)
Sets the size of this code element.void
setUrl(java.lang.String url)
Sets the URL where more information about this code element can be found.void
setVisibility(java.lang.String visibility)
Sets the visibility of this code element.
-
Method Details
-
getRole
Gets the role of this code element; Primary or Supporting.- Returns:
- a CodeElementRole enum
-
getName
public java.lang.String getName()Gets the name of this code element.- Returns:
- the name, as a String
-
getType
public java.lang.String getType()Gets the type (fully qualified type name) of this code element.- Returns:
- the type, as a String
-
getPackage
public java.lang.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 java.lang.String getDescription()Gets the description of this code element.- Returns:
- the description, as a String
-
setDescription
public void setDescription(java.lang.String description)Sets the description of this code element.- Parameters:
description
- the description, as a String
-
getUrl
public java.lang.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(java.lang.String url)Sets the URL where more information about this code element can be found.- Parameters:
url
- the URL as a String- Throws:
java.lang.IllegalArgumentException
- if the URL is not a well-formed URL
-
getLanguage
public java.lang.String getLanguage()Gets the programming language of this code element.- Returns:
- the programming language, as a String
-
setLanguage
public void setLanguage(java.lang.String language)Sets the programming language of this code element.- Parameters:
language
- the programming language, as a String
-
getCategory
public java.lang.String getCategory()Gets the category of this code element (interface, class, etc).- Returns:
- the category, as a String
-
setCategory
public void setCategory(java.lang.String category)Sets the category of this code element.- Parameters:
category
- the category, as a String
-
getVisibility
public java.lang.String getVisibility()Gets the visibility of this code element (public, package, etc).- Returns:
- the visibility, as a String
-
setVisibility
public void setVisibility(java.lang.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(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-