re base code
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / CapabilityTypeDataDefinition.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 CapabilityTypeDataDefinition extends ToscaDataDefinition {
29
30         public CapabilityTypeDataDefinition(CapabilityTypeDataDefinition 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.setCreationTime (cdt.getCreationTime());
37                 this.setModificationTime (cdt.getModificationTime());           
38         }
39
40         public CapabilityTypeDataDefinition() {
41                 super();
42         }
43
44         public String getUniqueId() {
45                 return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
46         }
47
48         public void setUniqueId(String uniqueId) {
49                 setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
50         }
51
52         public String getDescription() {
53                 return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
54         }
55
56         public void setDescription(String description) {
57                 setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
58         }
59
60         public String getType() {
61                 return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
62         }
63
64         public void setType(String type) {
65                 setToscaPresentationValue(JsonPresentationFields.TYPE, type);
66         }
67
68         public List<String> getValidSourceTypes() {
69                 return (List<String> ) getToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE);
70         }
71
72         public void setValidSourceTypes(List<String> validSourceTypes) {
73                 setToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE, validSourceTypes);
74         }
75
76         public String getVersion() {
77                 return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
78         }
79
80         public void setVersion(String version) {
81                 setToscaPresentationValue(JsonPresentationFields.VERSION, version);
82         }
83
84         public Long getCreationTime() {
85                 return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_TIME);
86         }
87
88         public void setCreationTime(Long creationTime) {
89                 setToscaPresentationValue(JsonPresentationFields.CREATION_TIME, creationTime);
90         }
91
92         public Long getModificationTime() {
93                 return (Long) getToscaPresentationValue(JsonPresentationFields.MODIFICATION_TIME);
94         }
95
96         public void setModificationTime(Long modificationTime) {
97                 setToscaPresentationValue(JsonPresentationFields.MODIFICATION_TIME, modificationTime);
98         }
99
100         @Override
101         public String toString() {
102                 String uniqueId = getUniqueId();
103                 String description = getDescription();
104                 String type = getType();
105                 List<String> validSourceTypes = getValidSourceTypes();
106                 String version = getVersion();
107                 Long creationTime = getCreationTime();
108                 Long modificationTime = getModificationTime();
109                 
110                 return "CapabilityTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type
111                                 + ", validSourceTypes=" + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime
112                                 + ", modificationTime=" + modificationTime + "]";
113         }
114
115 }