[SDC] rebase 1710 code
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / RelationshipInstDataDefinition.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 import java.util.List;
25
26 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
27 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
28
29 public class RelationshipInstDataDefinition extends ToscaDataDefinition implements Serializable {
30
31         /**
32          * 
33          */
34         private static final long serialVersionUID = 1104043358598884458L;
35
36         public RelationshipInstDataDefinition(RelationshipInstDataDefinition cdt) {
37                 super();
38                 this.setUniqueId(cdt.getUniqueId());
39                 this.setDescription(cdt.getDescription());
40                 this.setType(cdt.getType());
41                 this.setValidSourceTypes(cdt.getValidSourceTypes());
42                 this.setVersion(cdt.getVersion());
43                 this.setCreationTime(cdt.getCreationTime());
44                 this.setModificationTime(cdt.getModificationTime());
45                 this.setCapabilityOwnerId(cdt.getCapabilityOwnerId());
46                 this.setRequirementOwnerId(cdt.getRequirementOwnerId());
47                 this.setCapabilityId(cdt.getCapabilityId());
48                 this.setRequirementId(cdt.getRequirementId());
49                 this.setFromId(cdt.getFromId());
50                 this.setToId(cdt.getToId());
51                 this.setRequirement(cdt.getRequirement());
52                 this.setCapability(cdt.getCapability());
53
54         }
55
56         public void setRequirement(String requirement) {
57                 setToscaPresentationValue(JsonPresentationFields.REQUIREMENT, requirement);
58         }
59
60         public String getRequirement() {
61                 return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT);
62         }
63         public void setCapability(String capability) {
64                 setToscaPresentationValue(JsonPresentationFields.CAPAPILITY, capability);
65         }
66
67         public String getCapability() {
68                 return (String) getToscaPresentationValue(JsonPresentationFields.CAPAPILITY);
69         }
70         public void setToId(Object toId) {
71                 setToscaPresentationValue(JsonPresentationFields.TO_ID, toId);
72         }
73
74         public void setFromId(Object fromId) {
75                 setToscaPresentationValue(JsonPresentationFields.FROM_ID, fromId);
76         }
77
78         public String getToId() {
79                 return (String) getToscaPresentationValue(JsonPresentationFields.TO_ID);
80         }
81
82         public String getFromId() {
83                 return (String) getToscaPresentationValue(JsonPresentationFields.FROM_ID);
84         }
85
86         public void setRequirementId(Object requirementId) {
87                 setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID, requirementId);
88         }
89
90         public void setCapabilityId(Object capabilityId) {
91                 setToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID, capabilityId);
92         }
93
94         public String getRequirementId() {
95                 return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID);
96         }
97
98         public String getCapabilityId() {
99                 return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID);
100         }
101
102         public void setRequirementOwnerId(Object requirementOwnerId) {
103                 setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_OWNER_ID, requirementOwnerId);
104         }
105
106         public String getRequirementOwnerId() {
107                 return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT_OWNER_ID);
108         }
109
110         public void setCapabilityOwnerId(Object capabilityOwnerId) {
111                 setToscaPresentationValue(JsonPresentationFields.CAPABILTY_OWNER_ID, capabilityOwnerId);
112         }
113
114         public String getCapabilityOwnerId() {
115                 return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILTY_OWNER_ID);
116         }
117
118         public RelationshipInstDataDefinition() {
119         }
120
121         public String getUniqueId() {
122                 return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
123         }
124
125         public void setUniqueId(String uniqueId) {
126                 setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
127         }
128
129         public String getDescription() {
130                 return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
131         }
132
133         public void setDescription(String description) {
134                 setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
135         }
136
137         /** Identifies the type of the capability. */
138         public String getType() {
139                 return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
140         }
141
142         public void setType(String type) {
143                 setToscaPresentationValue(JsonPresentationFields.TYPE, type);
144         }
145
146         public List<String> getValidSourceTypes() {
147                 return (List<String>) getToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPES);
148         }
149
150         public void setValidSourceTypes(List<String> validSourceTypes) {
151                 setToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPES, validSourceTypes);
152         }
153
154         public String getVersion() {
155                 return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
156         }
157
158         public void setVersion(String version) {
159                 setToscaPresentationValue(JsonPresentationFields.VERSION, version);
160         }
161
162         public Long getCreationTime() {
163                 return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_TIME);
164
165         }
166
167         public void setCreationTime(Long creationTime) {
168                 setToscaPresentationValue(JsonPresentationFields.CREATION_TIME, creationTime);
169         }
170
171         public Long getModificationTime() {
172                 return (Long) getToscaPresentationValue(JsonPresentationFields.MODIFICATION_TIME);
173         }
174
175         public void setModificationTime(Long modificationTime) {
176                 setToscaPresentationValue(JsonPresentationFields.MODIFICATION_TIME, modificationTime);
177         }
178
179         @Override
180         public String toString() {
181                 String uniqueId = getUniqueId();
182                 String description = getDescription();
183                 String type = getType();
184                 List<String> validSourceTypes = getValidSourceTypes();
185                 String version = getVersion();
186                 Long creationTime = getCreationTime();
187                 Long modificationTime = getModificationTime();
188
189                 return "RelationshipTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime + ", modificationTime="
190                                 + modificationTime + "]";
191         }
192
193 }