public class GraphModel extends Object
It is based on JAXB.
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_NAME
The current model XML tag name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOrReplaceData(DataModel data)
Adds the given
DataModel to the list if its DataModel.getKey() is not already there or replaces
it else. |
void |
addOrReplaceEdge(EdgeModel edge)
Adds the given
EdgeModel to the list if its EdgeModel.getId() is not already there or replaces
it else. |
void |
addOrReplaceNode(NodeModel node)
Adds the given
NodeModel to the list if its NodeModel.getId() is not already there or replaces
it else. |
static WithId<String,WithDirection<WithData<WithNodes<WithEdges<Build<GraphModel>>>>>> |
builder()
A builder to the current
GraphModel class. |
List<DataModel> |
getData()
Returns the current graph's properties list.
|
String |
getEdgeDefault()
Returns the graph's <edgedefault> property.
|
List<EdgeModel> |
getEdges()
Returns the graph's edges as a list.
|
String |
getId()
Returns the graph ID.
|
List<NodeModel> |
getNodes()
Returns the graph(s nodes as a list.
|
boolean |
isChildOfNode(NodeModel node)
Tells whether or not the current graph is a child of a node (or if it stands alone).
|
boolean |
isEmpty()
Tells whether or not the current graph is empty.
|
boolean |
isNotEmpty()
Tells whether or not the current graph is not empty.
|
void |
setAspect(String aspect)
Sets the graph's aspect.
|
void |
setId(String id)
Sets the graph's ID.
|
void |
setTitle(String title)
Sets a <data> tag of type
C4Keys.TITLE and with the given value. |
public static final String TAG_NAME
public static WithId<String,WithDirection<WithData<WithNodes<WithEdges<Build<GraphModel>>>>>> builder()
GraphModel class.GraphModel instance.public void addOrReplaceData(DataModel data)
DataModel to the list if its DataModel.getKey() is not already there or replaces
it else.data - the given DataModel to add/replace.public void addOrReplaceEdge(EdgeModel edge)
EdgeModel to the list if its EdgeModel.getId() is not already there or replaces
it else.edge - the given EdgeModel to add/replace.public void addOrReplaceNode(NodeModel node)
NodeModel to the list if its NodeModel.getId() is not already there or replaces
it else.node - the given NodeModel to add/replace.public List<DataModel> getData()
DataModel list.public String getEdgeDefault()
public List<EdgeModel> getEdges()
EdgeModel list.public String getId()
public List<NodeModel> getNodes()
NodeModel list.public boolean isChildOfNode(NodeModel node)
node - the NodeModel that is supposed to be the the parent node.true if the graph is a child of the given node, false else.public boolean isEmpty()
true if the graph is empty, false else.public boolean isNotEmpty()
true if the graph is not empty, false else.public void setAspect(String aspect)
aspect - the graph aspect.public void setId(String id)
id - the graph idpublic void setTitle(String title)
C4Keys.TITLE and with the given value.title - the data value to set.Copyright © 2020. All rights reserved.