Package com.structurizr.model
Class Container
- All Implemented Interfaces:
Documentable
,PropertyHolder
Represents a "container" in the C4 model.
-
Method Summary
Modifier and TypeMethodDescriptionaddComponent
(String name) Adds a component to this container.addComponent
(String name, Class type, String description, String technology) Adds a component to this container.addComponent
(String name, String description) Adds a component to this container.addComponent
(String name, String description, String technology) Adds a component to this container.addComponent
(String name, String type, String description, String technology) Adds a component to this container.Gets the canonical name of this container, in the form "/Software System/Container".getComponentOfType
(String type) Gets the component of the specified type.Gets the set of components within this software system.getComponentWithName
(String name) Gets the component with the specified name.Gets the documentation associated with this container.Gets the parent software system.Gets the parent software system.Gets the technology associated with this container (e.g.void
setTechnology
(String technology) Sets the technology associated with this container.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, uses
Methods inherited from class com.structurizr.model.GroupableElement
getGroup, setGroup
Methods inherited from class com.structurizr.model.Element
getDescription, getEfferentRelationshipsWith, getEfferentRelationshipWith, getEfferentRelationshipWith, getModel, getName, getRelationships, hasAfferentRelationships, hasEfferentRelationshipWith, hasEfferentRelationshipWith, setDescription, setModel, toString, uses, uses, uses
Methods inherited from class com.structurizr.model.ModelItem
addPerspective, addProperty, addTags, getId, getPerspectives, getProperties, getTags, getTagsAsSet, getUrl, hasTag, removeTag, setUrl
-
Method Details
-
getParent
Gets the parent software system. -
getSoftwareSystem
Gets the parent software system.- Returns:
- the parent SoftwareSystem instance
-
getTechnology
Gets the technology associated with this container (e.g. "Spring MVC application").- Returns:
- the technology, as a String, or null if no technology has been specified
-
setTechnology
Sets the technology associated with this container.- Parameters:
technology
- the technology, as a String
-
addComponent
Adds a component to this container.- Parameters:
name
- the name of the component- Returns:
- the resulting Component instance
- Throws:
IllegalArgumentException
- if the component name is null or empty, or a component with the same name already exists
-
addComponent
Adds a component to this container.- Parameters:
name
- the name of the componentdescription
- a description of the component- Returns:
- the resulting Component instance
- Throws:
IllegalArgumentException
- if the component name is null or empty, or a component with the same name already exists
-
addComponent
Adds a component to this container.- Parameters:
name
- the name of the componentdescription
- a description of the componenttechnology
- the technology of the component- Returns:
- the resulting Component instance
- Throws:
IllegalArgumentException
- if the component name is null or empty, or a component with the same name already exists
-
addComponent
Adds a component to this container.- Parameters:
name
- the name of the componenttype
- a Class instance representing the primary type of the componentdescription
- a description of the componenttechnology
- the technology of the component- Returns:
- the resulting Component instance
- Throws:
IllegalArgumentException
- if the component name is null or empty, or a component with the same name already exists
-
addComponent
Adds a component to this container.- Parameters:
name
- the name of the componenttype
- a String describing the fully qualified name of the primary type of the componentdescription
- a description of the componenttechnology
- the technology of the component- Returns:
- the resulting Component instance
- Throws:
IllegalArgumentException
- if the component name is null or empty, or a component with the same name already exists
-
getComponents
Gets the set of components within this software system.- Returns:
- a Set of Component objects
-
getComponentWithName
Gets the component with the specified name.- Parameters:
name
- the name of the component- Returns:
- the Component instance, or null if a component with the specified name does not exist
- Throws:
IllegalArgumentException
- if the name is null or empty
-
getComponentOfType
Gets the component of the specified type.- Parameters:
type
- the fully qualified type of the component- Returns:
- the Component instance, or null if a component with the specified type does not exist
- Throws:
IllegalArgumentException
- if the type is null or empty
-
getCanonicalName
Gets the canonical name of this container, in the form "/Software System/Container".- Specified by:
getCanonicalName
in classModelItem
- Returns:
- the canonical name, as a String
-
getDefaultTags
- Specified by:
getDefaultTags
in classModelItem
-
getDocumentation
Gets the documentation associated with this container.- Specified by:
getDocumentation
in interfaceDocumentable
- Returns:
- a Documentation object
-