public class UmlObjectData
extends java.lang.Object
UmlObject
that can be initialised simply without any validation logic. This facilitates creation from both
real UML model (with builders), and from within the API (for testing without real UML model).
TODO: see whether we'll need the attribute since (for IEC 61850).
Implementation note: We have considered having this class inherit from
AbstractUmlObject
and then have concrete classes (such as, e.g., UmlPackage
)
inherit form this. However, we have discarded this option because it would force us to do lots of
checks in the code to avoid NPEs. We also considered making the data containers (such as
UmlPackage.Data
) inherit from this one, but then the creation of immutable objects (i.e., using
purely ctor params) would become extremely cumbersome. So, we prefer using this type in
composition, which is better modular and better testable.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_alias |
private TextDescription |
_htmlDescription |
private java.lang.Integer |
_id |
private java.lang.String |
_name |
private java.lang.String |
_since |
private UmlStereotype |
_stereotype |
private TextDescription |
_txtDescription |
private java.lang.String |
_uuid |
private UmlVisibility |
_visibility |
private static java.util.concurrent.atomic.AtomicInteger |
COUNTER |
Constructor and Description |
---|
UmlObjectData(java.lang.Integer id,
java.lang.String uuid,
java.lang.String name,
java.lang.String alias,
UmlStereotype stereotype,
java.lang.String eaVisibility,
TextDescription txtDoc,
TextDescription htmlDoc)
Constructor; accepts null arguments and initialises them with default values, so that all the
getters return non-null values.
|
UmlObjectData(java.lang.String name)
For testing only: Creates all not provided fields to default/empty/dumb values.
|
UmlObjectData(java.lang.String name,
java.lang.String alias,
TextDescription txtDoc,
TextDescription htmlDoc)
Constructor useful when collecting model content for documentation.
|
UmlObjectData(java.lang.String uuid,
java.lang.String name,
UmlStereotype stereotype)
For testing only: See
UmlObjectData(String, UmlStereotype) . |
UmlObjectData(java.lang.String name,
UmlStereotype stereotype)
For testing only: Creates all not provided fields to default/empty/dumb values.
|
UmlObjectData(UmlObject o)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlias() |
TextDescription |
getHtmlDescription() |
java.lang.Integer |
getId() |
java.lang.String |
getName() |
java.lang.String |
getSince() |
UmlStereotype |
getStereotype() |
TextDescription |
getTxtDescription() |
java.lang.String |
getUuid() |
UmlVisibility |
getVisibility() |
private static java.lang.Integer |
nextId()
Helper used to give a unique integer id (to simulate EA local id).
|
java.lang.String |
toString() |
private static final java.util.concurrent.atomic.AtomicInteger COUNTER
private final java.lang.Integer _id
private final java.lang.String _uuid
private final java.lang.String _since
private final java.lang.String _name
private final java.lang.String _alias
private final UmlStereotype _stereotype
private final UmlVisibility _visibility
private final TextDescription _txtDescription
private final TextDescription _htmlDescription
UmlObjectData(java.lang.String name)
UmlObjectData(java.lang.String name, UmlStereotype stereotype)
UmlObjectData(java.lang.String uuid, java.lang.String name, UmlStereotype stereotype)
UmlObjectData(String, UmlStereotype)
.public UmlObjectData(java.lang.String name, java.lang.String alias, TextDescription txtDoc, TextDescription htmlDoc)
public UmlObjectData(java.lang.Integer id, java.lang.String uuid, java.lang.String name, java.lang.String alias, UmlStereotype stereotype, java.lang.String eaVisibility, TextDescription txtDoc, TextDescription htmlDoc)
eaVisibility
(sets it to UmlVisibility.PUBLIC
) and for
uuid
(generates random UUID). In such a way, all the getters return non-null
values.id
- if null, sets it to auto-generated sequence number.uuid
- if null, sets it to an UUID generated from combination of id and name (note that
this is not guaranteed to produce a unique UUID, but we need repeatable values for
comparisons in tests and for debugging).name
- if null, sets it to empty string.alias
- if null, sets it to empty string.stereotype
- if null, sets it to empty stereotype.eaVisibility
- if null, sets it to UmlVisibility.PUBLIC
.txtDoc
- if null, sets it to empty string.htmlDoc
- if null, sets it to empty string.public UmlObjectData(UmlObject o)
private static java.lang.Integer nextId()
public java.lang.Integer getId()
public java.lang.String getUuid()
public java.lang.String getSince()
public java.lang.String getName()
public java.lang.String getAlias()
public UmlStereotype getStereotype()
public UmlVisibility getVisibility()
public TextDescription getTxtDescription()
public TextDescription getHtmlDescription()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2015 Tatjana (Tanja) Kostic