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