Package com.structurizr.model
Class Component
java.lang.Object
- All Implemented Interfaces:
PropertyHolder
public final class Component extends StaticStructureElement
Represents a "component" in the C4 model.
-
Method Summary
Modifier and Type Method Description CodeElementaddSupportingType(java.lang.String type)Adds a supporting type to this Component.java.lang.StringgetCanonicalName()Gets the canonical name of this component, in the form "/Software System/Container/Component".java.util.Set<CodeElement>getCode()Gets the set of CodeElement objects.ContainergetContainer()java.util.Set<java.lang.String>getDefaultTags()ElementgetParent()Gets the parent of this element.longgetSize()Gets the size of this Component (e.g.java.lang.StringgetTechnology()Gets the technology associated with this component (e.g.CodeElementgetType()Gets the type of this component (e.g.voidsetSize(long size)Sets the size of this component (e.g.voidsetTechnology(java.lang.String technology)Sets the technology associated with this component (e.g.CodeElementsetType(java.lang.String type)Sets the type of this component (e.g.Methods inherited from class com.structurizr.model.StaticStructureElement
delivers, delivers, delivers, delivers, uses, uses, uses, uses, uses, uses, uses, uses, uses, uses, uses, uses, uses, usesMethods inherited from class com.structurizr.model.Element
getDescription, getEfferentRelationshipsWith, getEfferentRelationshipWith, getEfferentRelationshipWith, getModel, getName, getRelationships, hasAfferentRelationships, hasEfferentRelationshipWith, hasEfferentRelationshipWith, setDescription, setModel, toString, uses, uses, usesMethods inherited from class com.structurizr.model.ModelItem
addPerspective, addProperty, addTags, getId, getOriginId, getPerspectives, getProperties, getTags, getTagsAsSet, getUrl, hasTag, removeTag, setUrl
-
Method Details
-
getParent
Description copied from class:ElementGets the parent of this element. -
getContainer
-
getTechnology
public java.lang.String getTechnology()Gets the technology associated with this component (e.g. "Spring Bean").- Returns:
- the technology, as a String, or null if no technology has been specified
-
setTechnology
public void setTechnology(java.lang.String technology)Sets the technology associated with this component (e.g. "Spring Bean").- Parameters:
technology- the technology, as a String
-
getType
Gets the type of this component (e.g. a fully qualified Java interface/class name).- Returns:
- the type, as a String
-
setType
Sets the type of this component (e.g. a fully qualified Java interface/class name).- Parameters:
type- the fully qualified type name- Returns:
- the CodeElement that was created
- Throws:
java.lang.IllegalArgumentException- if the specified type is null
-
getCode
Gets the set of CodeElement objects.- Returns:
- a Set, which could be empty
-
addSupportingType
Adds a supporting type to this Component.- Parameters:
type- the fully qualified type name- Returns:
- a CodeElement representing the supporting type
- Throws:
java.lang.IllegalArgumentException- if the specified type is null
-
getSize
public long getSize()Gets the size of this Component (e.g. number of lines).- Returns:
- the size of this component, as a long
-
setSize
public void setSize(long size)Sets the size of this component (e.g. number of lines).- Parameters:
size- the size
-
getCanonicalName
public java.lang.String getCanonicalName()Gets the canonical name of this component, in the form "/Software System/Container/Component".- Specified by:
getCanonicalNamein classModelItem- Returns:
- the canonical name, as a String
-
getDefaultTags
public java.util.Set<java.lang.String> getDefaultTags()- Specified by:
getDefaultTagsin classModelItem
-