Package com.structurizr.model
Class Element
java.lang.Object
com.structurizr.model.ModelItem
com.structurizr.model.Element
- All Implemented Interfaces:
PropertyHolder
,Comparable<ModelItem>
- Direct Known Subclasses:
GroupableElement
This is the superclass for all model elements.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a description of this element.getEfferentRelationshipsWith
(Element element) Gets the efferent (outgoing) relationship with the specified element.getEfferentRelationshipWith
(Element element) Gets the efferent (outgoing) relationship with the specified element.getEfferentRelationshipWith
(Element element, String description) Gets the efferent (outgoing) relationship with the specified element and description.getModel()
getName()
Gets the name of this element.abstract Element
Gets the parent of this element.Gets the set of outgoing relationships.boolean
Determines whether this element has afferent (incoming) relationships.boolean
hasEfferentRelationshipWith
(Element element) Determines whether this element has an efferent (outgoing) relationship with the specified element.boolean
hasEfferentRelationshipWith
(Element element, String description) Determines whether this element has an efferent (outgoing) relationship with the specified element and description.void
setDescription
(String description) Sets the description of this element.protected void
toString()
uses
(CustomElement destination, String description) Adds a unidirectional "uses" style relationship between this element and the specified custom element.uses
(CustomElement destination, String description, String technology) Adds a unidirectional "uses" style relationship between this element and the specified custom element.uses
(CustomElement destination, String description, String technology, InteractionStyle interactionStyle, String[] tags) Adds a unidirectional "uses" style relationship between this element and the specified custom element.Methods inherited from class com.structurizr.model.ModelItem
addPerspective, addPerspective, addProperty, addTags, compareTo, getCanonicalName, getDefaultTags, getId, getPerspectives, getProperties, getTags, getTagsAsSet, getUrl, hasTag, removeTag, setId, setUrl
-
Constructor Details
-
Element
protected Element()
-
-
Method Details
-
getModel
-
setModel
-
getName
Gets the name of this element.- Returns:
- the name, as a String
-
getDescription
Gets a description of this element.- Returns:
- the description, as a String
-
setDescription
Sets the description of this element.- Parameters:
description
- the description, as a String
-
getParent
Gets the parent of this element.- Returns:
- the parent Element, or null if this element doesn't have a parent (i.e. a Person or SoftwareSystem)
-
getRelationships
Gets the set of outgoing relationships.- Returns:
- a Set of Relationship objects, or an empty set if none exist
-
hasAfferentRelationships
public boolean hasAfferentRelationships()Determines whether this element has afferent (incoming) relationships.- Returns:
- true if this element has afferent relationships, false otherwise
-
hasEfferentRelationshipWith
Determines whether this element has an efferent (outgoing) relationship with the specified element.- Parameters:
element
- the element to look for- Returns:
- true if this element has an efferent relationship with the specified element, false otherwise
-
hasEfferentRelationshipWith
Determines whether this element has an efferent (outgoing) relationship with the specified element and description.- Parameters:
element
- the element to look fordescription
- the relationship description- Returns:
- true if this element has an efferent relationship with the specified element and description, false otherwise
-
getEfferentRelationshipWith
Gets the efferent (outgoing) relationship with the specified element.- Parameters:
element
- the element to look for- Returns:
- a Relationship object if an efferent relationship exists, null otherwise
-
getEfferentRelationshipsWith
Gets the efferent (outgoing) relationship with the specified element.- Parameters:
element
- the element to look for- Returns:
- a Set of Relationship objects; empty if no relationships exist
-
getEfferentRelationshipWith
Gets the efferent (outgoing) relationship with the specified element and description.- Parameters:
element
- the element to look fordescription
- the relationship description- Returns:
- a Relationship object, or null if the specified relationship doesn't exist
-
uses
Adds a unidirectional "uses" style relationship between this element and the specified custom element.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull CustomElement destination, String description, String technology) Adds a unidirectional "uses" style relationship between this element and the specified custom element.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)- Returns:
- the relationship that has just been created and added to the model
-
uses
@Nullable public Relationship uses(@Nonnull CustomElement destination, String description, String technology, InteractionStyle interactionStyle, String[] tags) Adds a unidirectional "uses" style relationship between this element and the specified custom element.- Parameters:
destination
- the target of the relationshipdescription
- a description of the relationship (e.g. "uses", "gets data from", "sends data to")technology
- the technology details (e.g. JSON/HTTPS)interactionStyle
- the interaction style (sync vs async)tags
- an array of tags- Returns:
- the relationship that has just been created and added to the model
-
toString
-