Implement Attributes/Outputs BE (part 2)
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / AttributeDataDefinition.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2020, Nordix Foundation. 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 package org.openecomp.sdc.be.datatypes.elements;
21
22 import java.util.List;
23 import lombok.Getter;
24 import lombok.NoArgsConstructor;
25 import lombok.Setter;
26 import org.onap.sdc.tosca.datatypes.model.EntrySchema;
27 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
28 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
29
30 @Getter
31 @Setter
32 @NoArgsConstructor
33 public class AttributeDataDefinition extends ToscaDataDefinition {
34
35     private List<GetOutputValueDataDefinition> getOutputValues;
36     private String outputId;
37     private String value;
38     private String outputPath;
39     private String instanceUniqueId;
40     private String attributeId;
41     private String parentUniqueId;
42
43     public AttributeDataDefinition(final AttributeDataDefinition attributeDataDefinition) {
44         super();
45         this.setUniqueId(attributeDataDefinition.getUniqueId());
46         this.setOwnerId(attributeDataDefinition.getOwnerId());
47         this.setName(attributeDataDefinition.getName());
48         this.setType(attributeDataDefinition.getType());
49         this.setDescription(attributeDataDefinition.getDescription());
50         this.set_default(attributeDataDefinition.get_default());
51         this.setValue(attributeDataDefinition.getValue());
52         this.setStatus(attributeDataDefinition.getStatus());
53         this.setEntry_schema(attributeDataDefinition.getEntry_schema());
54         this.setSchema(attributeDataDefinition.getSchema());
55         this.setOutputPath(attributeDataDefinition.getOutputPath());
56         this.setInstanceUniqueId(attributeDataDefinition.getInstanceUniqueId());
57         this.setAttributeId(attributeDataDefinition.getAttributeId());
58         this.setParentUniqueId(attributeDataDefinition.getParentUniqueId());
59     }
60
61     public String getUniqueId() {
62         return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
63     }
64
65     public void setUniqueId(final String uniqueId) {
66         setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
67     }
68
69     @Override
70     public String getOwnerId() {
71         return (String) getToscaPresentationValue(JsonPresentationFields.OWNER_ID);
72     }
73
74     @Override
75     public void setOwnerId(final String ownerId) {
76         setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId);
77     }
78
79     public String getName() {
80         return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
81     }
82
83     public void setName(final String name) {
84         setToscaPresentationValue(JsonPresentationFields.NAME, name);
85     }
86
87     @Override
88     public String getType() {
89         return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
90     }
91
92     @Override
93     public void setType(final String type) {
94         setToscaPresentationValue(JsonPresentationFields.TYPE, type);
95     }
96
97     public String getDescription() {
98         return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
99     }
100
101     public void setDescription(final String description) {
102         setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
103     }
104
105     public Object get_default() {
106         return getToscaPresentationValue(JsonPresentationFields.DEFAULT);
107     }
108
109     public void set_default(final Object _default) {
110         setToscaPresentationValue(JsonPresentationFields.DEFAULT, _default);
111     }
112
113     public String getStatus() {
114         return (String) getToscaPresentationValue(JsonPresentationFields.STATUS);
115     }
116
117     public void setStatus(final String status) {
118         setToscaPresentationValue(JsonPresentationFields.STATUS, status);
119     }
120
121     public EntrySchema getEntry_schema() {
122         return (EntrySchema) getToscaPresentationValue(JsonPresentationFields.SCHEMA);
123     }
124
125     public void setEntry_schema(final EntrySchema entrySchema) {
126         setToscaPresentationValue(JsonPresentationFields.SCHEMA, entrySchema);
127     }
128
129     public SchemaDefinition getSchema() {
130         return (SchemaDefinition) getToscaPresentationValue(JsonPresentationFields.SCHEMA);
131     }
132
133     public String getParentUniqueId() {
134         return getOwnerId();
135     }
136
137 }