1 package org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation;
3 import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
5 import java.util.ArrayList;
6 import java.util.HashMap;
11 * The type Entity consolidation data.
13 public class EntityConsolidationData {
15 private String nodeTemplateId;
17 //groups that point to this entity node template
18 private List<String> groupIds;
20 // key - node template id which has connection to this entity
21 // value - List of Requirement assignment data which connect to this entity
22 private Map<String, List<RequirementAssignmentData>> nodesConnectedIn;
24 // key - node template id which connected from this entity
25 // List of Requirement assignment data which connect to the key node template id
26 private Map<String, List<RequirementAssignmentData>> nodesConnectedOut;
28 //key - node template id which include get attribute function from this entity
29 //key - node template id which include get attribute function from this entity
30 //value - List of getAttr data
31 private Map<String, List<GetAttrFuncData>> nodesGetAttrIn;
33 //key - node template id which is pointed by this entity using get attribute function
34 //value - List of getAttr data
35 private Map<String, List<GetAttrFuncData>> nodesGetAttrOut;
37 //List of getAttr data
38 private List<GetAttrFuncData> outputParametersGetAttrIn;
41 * Gets node template id.
43 * @return the node template id
45 public String getNodeTemplateId() {
46 return nodeTemplateId;
50 * Sets node template id.
52 * @param nodeTemplateId the node template id
54 public void setNodeTemplateId(String nodeTemplateId) {
55 this.nodeTemplateId = nodeTemplateId;
59 * Gets group ids point to me.
61 * @return the group ids point to me
63 public List<String> getGroupIds() {
68 * Sets group ids point to me.
70 * @param groupIds the group ids point to me
72 public void setGroupIds(List<String> groupIds) {
73 this.groupIds = groupIds;
78 * Sets node connected to me.
80 * @param nodesConnectedIn the node connected to me
82 public void setNodesConnectedIn(Map<String, List<RequirementAssignmentData>> nodesConnectedIn) {
83 this.nodesConnectedIn = nodesConnectedIn;
87 * Add nodeConnectedIn.
89 * @param nodeTemplateId the node template id which has connection to me
90 * @param requirementId the requirement id
91 * @param requirementAssignment the requirement assignment
93 public void addNodesConnectedIn(String nodeTemplateId, String requirementId,
94 RequirementAssignment requirementAssignment) {
95 if (this.nodesConnectedIn == null) {
96 this.nodesConnectedIn = new HashMap<>();
98 this.nodesConnectedIn.computeIfAbsent(nodeTemplateId, k -> new ArrayList<>());
99 this.nodesConnectedIn.get(nodeTemplateId).add(new RequirementAssignmentData(requirementId,
100 requirementAssignment));
104 * Gets node connected to me.
106 * @return the node connected to me
108 public Map<String, List<RequirementAssignmentData>> getNodesConnectedIn() {
109 return nodesConnectedIn;
114 * Gets node connected from me.
116 * @return the node connected from me
118 public Map<String, List<RequirementAssignmentData>> getNodesConnectedOut() {
119 return nodesConnectedOut;
123 * Sets node connected from me.
125 * @param nodesConnectedOut the node connected from me
127 public void setNodesConnectedOut(
128 Map<String, List<RequirementAssignmentData>> nodesConnectedOut) {
129 this.nodesConnectedOut = nodesConnectedOut;
133 * Add nodeConnectedOut.
135 * @param nodeTemplateId the node template id which is connected from me
136 * @param requirementId the requirement id
137 * @param requirementAssignment the requirement assignment
139 public void addNodesConnectedOut(String nodeTemplateId, String requirementId,
140 RequirementAssignment
141 requirementAssignment) {
142 if (this.nodesConnectedOut == null) {
143 this.nodesConnectedOut = new HashMap<>();
145 this.nodesConnectedOut.computeIfAbsent(nodeTemplateId, k -> new ArrayList<>());
146 this.nodesConnectedOut.get(nodeTemplateId).add(new RequirementAssignmentData(requirementId,
147 requirementAssignment));
151 * Gets nodes get attr in.
153 * @return the get attr in
155 public Map<String, List<GetAttrFuncData>> getNodesGetAttrIn() {
156 return nodesGetAttrIn;
160 * Sets nodes get attr in.
162 * @param nodesGetAttrIn the get attr in
164 public void setNodesGetAttrIn(
165 Map<String, List<GetAttrFuncData>> nodesGetAttrIn) {
166 this.nodesGetAttrIn = nodesGetAttrIn;
170 * Add nodes get attr in data.
172 * @param nodeTemplateId the node template id
173 * @param getAttrFuncData get attr data
175 public void addNodesGetAttrIn(String nodeTemplateId, GetAttrFuncData getAttrFuncData) {
176 if (nodesGetAttrIn == null) {
177 nodesGetAttrIn = new HashMap<>();
179 this.nodesGetAttrIn.putIfAbsent(nodeTemplateId, new ArrayList<>());
180 this.nodesGetAttrIn.get(nodeTemplateId).add(getAttrFuncData);
184 * Gets output parameters get attr from me.
186 * @return the get attr from me
188 public List<GetAttrFuncData> getOutputParametersGetAttrIn() {
189 return outputParametersGetAttrIn;
193 * Sets output parameters get attr from me.
195 * @param outputParametersGetAttrIn the output parameters get attr from me
197 public void setOutputParametersGetAttrIn(List<GetAttrFuncData> outputParametersGetAttrIn) {
198 this.outputParametersGetAttrIn = outputParametersGetAttrIn;
202 * Add output parameters get attr data.
204 * @param getAttrFuncData get attr data
206 public void addOutputParamGetAttrIn(GetAttrFuncData getAttrFuncData) {
207 if (outputParametersGetAttrIn == null) {
208 outputParametersGetAttrIn = new ArrayList<>();
210 this.outputParametersGetAttrIn.add(getAttrFuncData);
214 * Gets nodes get attr out.
216 * @return the get attr out
218 public Map<String, List<GetAttrFuncData>> getNodesGetAttrOut() {
219 return nodesGetAttrOut;
223 * Sets nodes get attr out.
225 * @param nodesGetAttrOut the get attr out
227 public void setNodesGetAttrOut(
228 Map<String, List<GetAttrFuncData>> nodesGetAttrOut) {
229 this.nodesGetAttrOut = nodesGetAttrOut;
233 * Add nodes get attr out data.
235 * @param nodeTemplateId the node template id
236 * @param getAttrFuncData get attr data
238 public void addNodesGetAttrOut(String nodeTemplateId, GetAttrFuncData getAttrFuncData) {
239 if (nodesGetAttrOut == null) {
240 nodesGetAttrOut = new HashMap<>();
242 this.nodesGetAttrOut.putIfAbsent(nodeTemplateId, new ArrayList<>());
243 this.nodesGetAttrOut.get(nodeTemplateId).add(getAttrFuncData);