Service Consumption BE
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / merge / instance / DataForMergeHolder.java
1 package org.openecomp.sdc.be.components.merge.instance;
2
3
4 import org.openecomp.sdc.be.model.*;
5
6 import java.util.*;
7
8 /**
9  * Created by chaya on 9/7/2017.
10  */
11 public class DataForMergeHolder {
12
13     private List<ComponentInstanceInput> origComponentInstanceInputs;
14     private List<ComponentInstanceProperty> origComponentInstanceProperties;
15     private List<InputDefinition> origComponentInputs;
16     private Map<String, ArtifactDefinition> origCompInstDeploymentArtifactsCreatedOnTheInstance;
17     private Map<String, ArtifactDefinition> origCompInstInformationalArtifactsCreatedOnTheInstance;
18     private Map<String, List<String>> origComponentInstanceExternalRefs;
19     private List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts;
20     private ContainerRelationsMergeInfo containerRelationsMergeInfo;
21     private List<CapabilityDefinition> origInstanceCapabilities;
22     private Component origInstanceNode;
23     private Component currInstanceNode;
24     private String origComponentInstId;
25     private List<ComponentInstanceInterface> origComponentInstanceInterfaces;
26
27     public DataForMergeHolder() {
28         origComponentInstanceInputs = new ArrayList<>();
29         origComponentInstanceProperties = new ArrayList<>();
30         origComponentInputs = new ArrayList<>();
31         origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
32         origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
33         origInstanceCapabilities = new ArrayList<>();
34         origComponentInstanceInterfaces = new ArrayList<>();
35     }
36
37     List<ArtifactDefinition> getOrigComponentInstanceHeatEnvArtifacts() {
38         return origComponentInstanceHeatEnvArtifacts;
39     }
40
41     void setOrigComponentInstanceHeatEnvArtifacts(List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts) {
42         this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts;
43     }
44
45     List<ComponentInstanceInput> getOrigComponentInstanceInputs() {
46         return origComponentInstanceInputs;
47     }
48
49     void setOrigComponentInstanceInputs(List<ComponentInstanceInput> origComponentInstanceInputs) {
50         Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> {
51             ComponentInstanceInput copyInput = new ComponentInstanceInput();
52             copyInput.setType(input.getType());
53             copyInput.setPath(input.getPath());
54             copyInput.setRules(input.getRules());
55             copyInput.setValueUniqueUid(input.getValueUniqueUid());
56             copyInput.setDefaultValue(input.getDefaultValue());
57             copyInput.setDescription(input.getDescription());
58             copyInput.setGetInputValues(input.getGetInputValues());
59             copyInput.setInputId(input.getInputId());
60             copyInput.setInputPath(input.getInputPath());
61             copyInput.setInputs(input.getInputs());
62             copyInput.setLabel(input.getLabel());
63             copyInput.setName(input.getName());
64             copyInput.setParentUniqueId(input.getParentUniqueId());
65             copyInput.setProperties(input.getProperties());
66             copyInput.setPropertyId(input.getPropertyId());
67             copyInput.setSchema(input.getSchema());
68             copyInput.setStatus(input.getStatus());
69             copyInput.setDefaultValue(input.getDefaultValue());
70             copyInput.setValue(input.getValue());
71             this.origComponentInstanceInputs.add(copyInput);
72         });
73     }
74
75     List<ComponentInstanceProperty> getOrigComponentInstanceProperties() {
76         return origComponentInstanceProperties;
77     }
78
79     void setOrigComponentInstanceProperties(List<ComponentInstanceProperty> origComponentInstanceProperties) {
80         Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> {
81             ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty();
82             propertyCopy.setType(property.getType());
83             propertyCopy.setName(property.getName());
84             propertyCopy.setValue(property.getValue());
85             propertyCopy.setUniqueId(property.getUniqueId());
86             propertyCopy.setDefaultValue(property.getDefaultValue());
87             propertyCopy.setInputId(property.getInputId());
88             propertyCopy.setGetInputValues(property.getGetInputValues());
89             this.origComponentInstanceProperties.add(propertyCopy);
90         });
91     }
92
93     List<InputDefinition> getOrigComponentInputs() {
94         return origComponentInputs;
95     }
96
97     void setOrigComponentInputs(List<InputDefinition> origComponentInputs) {
98         this.origComponentInputs = origComponentInputs;
99     }
100
101     Map<String, ArtifactDefinition> getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;}
102
103     Map<String, ArtifactDefinition> getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;}
104
105     void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origDeploymentArtifacts){
106         origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts;
107     }
108
109     void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origInformationalArtifacts){
110         origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts;
111     }
112
113     Map<String, List<String>> getOrigCompInstExternalRefs() {
114         return origComponentInstanceExternalRefs;
115     }
116
117     void setOrigComponentInstanceExternalRefs(Map<String, List<String>> origComponentInstanceExternalRefs) {
118         this.origComponentInstanceExternalRefs = origComponentInstanceExternalRefs;
119     }
120
121     void setVfRelationsInfo(ContainerRelationsMergeInfo containerRelationsMergeInfo) {
122         this.containerRelationsMergeInfo = containerRelationsMergeInfo;
123     }
124
125     ContainerRelationsMergeInfo getContainerRelationsMergeInfo() {
126         return containerRelationsMergeInfo;
127     }
128
129     List<CapabilityDefinition> getOrigInstanceCapabilities() {
130         return origInstanceCapabilities;
131     }
132
133     void setOrigInstanceCapabilities(List<CapabilityDefinition> origInstanceCapabilities) {
134         this.origInstanceCapabilities = origInstanceCapabilities;
135     }
136
137     Component getOrigInstanceNode() {
138         return origInstanceNode;
139     }
140
141     void setOrigInstanceNode(Component origInstanceNode) {
142         this.origInstanceNode = origInstanceNode;
143     }
144
145     Component getCurrInstanceNode() {
146         return currInstanceNode;
147     }
148
149     public void setCurrInstanceNode(Component currInstanceNode) {
150         this.currInstanceNode = currInstanceNode;
151     }
152
153     public String getOrigComponentInstId() {
154         return origComponentInstId;
155     }
156
157     public void setOrigComponentInstId(String origComponentInstId) {
158         this.origComponentInstId = origComponentInstId;
159     }
160
161     public List<ComponentInstanceInterface> getOrigComponentInstanceInterfaces() {
162         return origComponentInstanceInterfaces;
163     }
164
165     public void setOrigComponentInstanceInterfaces(List<ComponentInstanceInterface> origComponentInstanceInterfaces) {
166         this.origComponentInstanceInterfaces = origComponentInstanceInterfaces;
167     }
168 }