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.
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,
java.lang.String alias,
TextDescription txtDoc,
TextDescription htmlDoc)
Constructor useful when collecting model content for documentation.
|
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() |
java.lang.String |
toString() |
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)
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-2016 Tatjana (Tanja) Kostic