Backend support for operation milestones with activities
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / OperationDataDefinition.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 com.fasterxml.jackson.annotation.JsonCreator;
24 import java.util.Map;
25 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
26 import org.openecomp.sdc.be.datatypes.enums.MilestoneTypeEnum;
27 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
28
29 import java.io.Serializable;
30
31 import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ASSOCIATION_TYPE;
32 import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ID;
33 import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_NAME;
34 import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION;
35 import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION_ID;
36
37 public class OperationDataDefinition extends ToscaDataDefinition implements Serializable {
38
39
40     @JsonCreator
41     public OperationDataDefinition() {
42         super();
43     }
44
45     public OperationDataDefinition(String description) {
46         super();
47         setDescription(description);
48     }
49
50     public OperationDataDefinition(OperationDataDefinition p) {
51         setMilestones(p.getMilestones());
52         setDescription(p.getDescription());
53         setImplementation(p.getImplementation());
54         setInputs(p.getInputs());
55         setOutputs(p.getOutputs());
56         setName(p.getName());
57         setUniqueId(p.getUniqueId());
58         setWorkflowId(p.getWorkflowId());
59         setWorkflowVersionId(p.getWorkflowVersionId());
60         setWorkflowAssociationType(p.getWorkflowAssociationType());
61         setWorkflowName(p.getWorkflowName());
62         setWorkflowVersion(p.getWorkflowVersion());
63     }
64
65     public void setMilestones(Map<String, MilestoneDataDefinition> milestones) {
66         setToscaPresentationValue(JsonPresentationFields.OPERATION_MILESTONES, milestones);
67     }
68
69     public Map<String, MilestoneDataDefinition>  getMilestones() {
70         return (Map<String, MilestoneDataDefinition> ) getToscaPresentationValue(
71             JsonPresentationFields.OPERATION_MILESTONES);
72     }
73
74     public String getDescription() {
75         return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
76     }
77
78     public void setDescription(String description) {
79         setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
80     }
81
82     public ArtifactDataDefinition getImplementation() {
83         return (ArtifactDataDefinition) getToscaPresentationValue(JsonPresentationFields.OPERATION_IMPLEMENTATION);
84     }
85
86     public void setImplementation(ArtifactDataDefinition implementation) {
87         setToscaPresentationValue(JsonPresentationFields.OPERATION_IMPLEMENTATION, implementation);
88     }
89
90     public ListDataDefinition<OperationInputDefinition> getInputs() {
91         return (ListDataDefinition<OperationInputDefinition>) getToscaPresentationValue(
92                 JsonPresentationFields.OPERATION_INPUTS);
93     }
94
95     public void setInputs(ListDataDefinition<OperationInputDefinition> inputs) {
96         setToscaPresentationValue(JsonPresentationFields.OPERATION_INPUTS, inputs);
97     }
98
99     public ListDataDefinition<OperationOutputDefinition> getOutputs() {
100         return (ListDataDefinition<OperationOutputDefinition>) getToscaPresentationValue(
101                 JsonPresentationFields.OPERATION_OUTPUTS);
102     }
103
104     public void setOutputs(ListDataDefinition<OperationOutputDefinition> outputs) {
105         setToscaPresentationValue(JsonPresentationFields.OPERATION_OUTPUTS, outputs);
106     }
107
108     public String getName() {
109         return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
110     }
111
112     public String getUniqueId() {
113         return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
114     }
115
116     public void setUniqueId(String uniqueId) {
117         setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
118     }
119
120     public String getWorkflowId() {
121         return (String) getToscaPresentationValue(IO_WORKFLOW_ID);
122     }
123
124     public void setWorkflowId(String workflowId) {
125         setToscaPresentationValue(IO_WORKFLOW_ID, workflowId);
126     }
127
128     public String getWorkflowName() {
129         return (String) getToscaPresentationValue(IO_WORKFLOW_NAME);
130     }
131
132     public void setWorkflowName(String workflowName) {
133         setToscaPresentationValue(IO_WORKFLOW_NAME, workflowName);
134     }
135
136     public String getWorkflowVersionId() {
137         return (String) getToscaPresentationValue(IO_WORKFLOW_VERSION_ID);
138     }
139
140     public void setWorkflowVersionId(String workflowVersionId) {
141         setToscaPresentationValue(IO_WORKFLOW_VERSION_ID, workflowVersionId);
142     }
143
144     public String getWorkflowVersion() {
145         return (String) getToscaPresentationValue(IO_WORKFLOW_VERSION);
146     }
147
148     public void setWorkflowVersion(String workflowVersion) {
149         setToscaPresentationValue(IO_WORKFLOW_VERSION, workflowVersion);
150     }
151
152     public String getWorkflowAssociationType() {
153         return (String) getToscaPresentationValue(IO_WORKFLOW_ASSOCIATION_TYPE);
154     }
155
156     public void setWorkflowAssociationType(String workflowAssociationType) {
157         setToscaPresentationValue(IO_WORKFLOW_ASSOCIATION_TYPE, workflowAssociationType);
158     }
159
160     public void setName(String name) {
161         setToscaPresentationValue(JsonPresentationFields.NAME, name);
162     }
163
164     public Long getCreationDate() {
165         return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_DATE);
166     }
167
168     public void setCreationDate(Long creationDate) {
169         setToscaPresentationValue(JsonPresentationFields.CREATION_DATE, creationDate);
170     }
171
172     public Long getLastUpdateDate() {
173         return (Long) getToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE);
174     }
175
176     public void setLastUpdateDate(Long lastUpdateDate) {
177         setToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate);
178     }
179 }