[sdc] - last merges before moving to LF
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / ComponentInstanceDataDefinition.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.datatypes.elements;
22
23 import java.io.Serializable;
24
25 import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
26 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
27 import org.openecomp.sdc.common.util.ValidationUtils;
28
29 public class ComponentInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
30
31         /**
32          * 
33          */
34         
35         private static final long serialVersionUID = 7215033872921497743L;
36
37         private String icon;
38         
39         private String uniqueId;
40
41         private String name;
42         
43         private String normalizedName;
44
45         private String componentUid;
46
47         private Long creationTime;
48
49         private Long modificationTime;
50
51         private String description;
52
53         private String posX;
54
55         private String posY;
56         private Integer propertyValueCounter = 1;
57         private Integer attributeValueCounter;
58         private Integer inputValueCounter = 1;
59         private OriginTypeEnum originType;
60         private String customizationUUID;
61         private String componentName;
62         private String componentVersion;
63         private String toscaComponentName;
64         private String invariantName;
65         
66         public ComponentInstanceDataDefinition() {
67                 super();
68         }
69
70         public ComponentInstanceDataDefinition(ComponentInstanceDataDefinition dataDefinition) {
71                 this.icon = dataDefinition.icon;
72                 this.uniqueId = dataDefinition.uniqueId;
73                 this.name = dataDefinition.name;
74                 this.componentUid = dataDefinition.componentUid;
75                 this.creationTime = dataDefinition.creationTime;
76                 this.modificationTime = dataDefinition.modificationTime;
77                 this.description = dataDefinition.description;
78                 this.posX = dataDefinition.posX;
79                 this.posY = dataDefinition.posY;
80                 this.propertyValueCounter = dataDefinition.propertyValueCounter;
81                 this.normalizedName = dataDefinition.normalizedName;
82                 this.originType = dataDefinition.originType;
83                 this.customizationUUID = dataDefinition.customizationUUID;
84                 this.componentName = dataDefinition.componentName;
85                 this.componentVersion = dataDefinition.componentVersion;
86                 this.toscaComponentName = dataDefinition.toscaComponentName;
87                 this.invariantName = dataDefinition.invariantName;
88         }
89         
90         public String getIcon() {
91                 return icon;
92         }
93
94         public void setIcon(String icon) {
95                 this.icon = icon;
96         }
97         public String getUniqueId() {
98                 return uniqueId;
99         }
100
101         public void setUniqueId(String uniqueId) {
102                 this.uniqueId = uniqueId;
103         }
104
105         public Long getCreationTime() {
106                 return creationTime;
107         }
108
109         public void setCreationTime(Long creationTime) {
110                 this.creationTime = creationTime;
111         }
112
113         public Long getModificationTime() {
114                 return modificationTime;
115         }
116
117         public void setModificationTime(Long modificationTime) {
118                 this.modificationTime = modificationTime;
119         }
120
121         public String getDescription() {
122                 return description;
123         }
124
125         public void setDescription(String description) {
126                 this.description = description;
127         }
128
129         public String getPosX() {
130                 return posX;
131         }
132
133         public void setPosX(String posX) {
134                 this.posX = posX;
135         }
136
137         public String getPosY() {
138                 return posY;
139         }
140
141         public void setPosY(String posY) {
142                 this.posY = posY;
143         }
144
145         public String getComponentUid() {
146                 return componentUid;
147         }
148
149         public void setComponentUid(String resourceUid) {
150                 this.componentUid = resourceUid;
151         }
152
153         public String getName() {
154                 return name;
155         }
156
157         public void setName(String name) {
158                 if(invariantName == null){
159                         invariantName = ValidationUtils.normalizeComponentInstanceName(name);
160                 }
161                 this.name = name;
162         }
163         
164         public String getInvariantName() {
165                 return invariantName;
166         }
167
168         public void setInvariantName(String invariantName) {
169                 this.invariantName = invariantName;
170         }
171
172         public Integer getPropertyValueCounter() {
173                 return propertyValueCounter;
174         }
175
176         public void setPropertyValueCounter(Integer propertyValueCounter) {
177                 this.propertyValueCounter = propertyValueCounter;
178         }
179
180         public String getNormalizedName() {
181                 return normalizedName;
182         }
183
184         public void setNormalizedName(String normalizedName) {
185                 this.normalizedName = normalizedName;
186         }
187
188         public OriginTypeEnum getOriginType() {
189                 return originType;
190         }
191
192         public void setOriginType(OriginTypeEnum originType) {
193                 this.originType = originType;
194         }
195
196         public Integer getAttributeValueCounter() {
197                 return attributeValueCounter;
198         }
199
200         public void setAttributeValueCounter(Integer attributeValueCounter) {
201                 this.attributeValueCounter = attributeValueCounter;
202         }
203
204         public Integer getInputValueCounter() {
205                 return inputValueCounter;
206         }
207
208         public void setInputValueCounter(Integer inputValueCounter) {
209                 this.inputValueCounter = inputValueCounter;
210         }
211
212         public String getCustomizationUUID() {
213                 return customizationUUID;
214         }
215
216         public void setCustomizationUUID(String customizationUUID) {
217                 this.customizationUUID = customizationUUID;
218         }
219
220         public String getComponentName() {
221                 return componentName;
222         }
223
224         public void setComponentName(String resourceName) {
225                 this.componentName = resourceName;
226         }
227
228         public String getComponentVersion() {
229                 return componentVersion;
230         }
231
232         public String getToscaComponentName() {
233                 return toscaComponentName;
234         }
235
236         public void setToscaComponentName(String toscaComponentName) {
237                 this.toscaComponentName = toscaComponentName;
238         }
239
240         public void setComponentVersion(String resourceVersion) {
241                 this.componentVersion = resourceVersion;
242         }
243
244         @Override
245         public String toString() {
246                 return "ComponentInstanceDataDefinition [icon=" + icon + ", uniqueId=" + uniqueId + ", name=" + name + ", normalizedName=" + normalizedName + ", componentUid=" + componentUid + ", creationTime=" + creationTime + ", modificationTime="
247                                 + modificationTime + ", description=" + description + ", posX=" + posX + ", posY=" + posY + ", propertyValueCounter=" + propertyValueCounter + ", attributeValueCounter=" + attributeValueCounter + ", inputValueCounter="
248                                 + inputValueCounter + ", originType=" + originType + ", customizationUUID=" + customizationUUID + ", componentName=" + componentName + ", componentVersion=" + componentVersion + ", toscaComponentName=" + toscaComponentName + "]";
249         }
250
251 }