re base code
[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
26     public DataForMergeHolder() {
27         origComponentInstanceInputs = new ArrayList<>();
28         origComponentInstanceProperties = new ArrayList<>();
29         origComponentInputs = new ArrayList<>();
30         origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
31         origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
32         origInstanceCapabilities = new ArrayList<>();
33     }
34
35     List<ArtifactDefinition> getOrigComponentInstanceHeatEnvArtifacts() {
36         return origComponentInstanceHeatEnvArtifacts;
37     }
38
39     void setOrigComponentInstanceHeatEnvArtifacts(List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts) {
40         this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts;
41     }
42
43     List<ComponentInstanceInput> getOrigComponentInstanceInputs() {
44         return origComponentInstanceInputs;
45     }
46
47     void setOrigComponentInstanceInputs(List<ComponentInstanceInput> origComponentInstanceInputs) {
48         Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> {
49             ComponentInstanceInput copyInput = new ComponentInstanceInput();
50             copyInput.setType(input.getType());
51             copyInput.setPath(input.getPath());
52             copyInput.setRules(input.getRules());
53             copyInput.setValueUniqueUid(input.getValueUniqueUid());
54             copyInput.setDefaultValue(input.getDefaultValue());
55             copyInput.setDescription(input.getDescription());
56             copyInput.setGetInputValues(input.getGetInputValues());
57             copyInput.setInputId(input.getInputId());
58             copyInput.setInputPath(input.getInputPath());
59             copyInput.setInputs(input.getInputs());
60             copyInput.setLabel(input.getLabel());
61             copyInput.setName(input.getName());
62             copyInput.setParentUniqueId(input.getParentUniqueId());
63             copyInput.setProperties(input.getProperties());
64             copyInput.setPropertyId(input.getPropertyId());
65             copyInput.setSchema(input.getSchema());
66             copyInput.setStatus(input.getStatus());
67             copyInput.setDefaultValue(input.getDefaultValue());
68             copyInput.setValue(input.getValue());
69             this.origComponentInstanceInputs.add(copyInput);
70         });
71     }
72
73     List<ComponentInstanceProperty> getOrigComponentInstanceProperties() {
74         return origComponentInstanceProperties;
75     }
76
77     void setOrigComponentInstanceProperties(List<ComponentInstanceProperty> origComponentInstanceProperties) {
78         Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> {
79             ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty();
80             propertyCopy.setType(property.getType());
81             propertyCopy.setName(property.getName());
82             propertyCopy.setValue(property.getValue());
83             propertyCopy.setUniqueId(property.getUniqueId());
84             propertyCopy.setDefaultValue(property.getDefaultValue());
85             propertyCopy.setInputId(property.getInputId());
86             propertyCopy.setGetInputValues(property.getGetInputValues());
87             this.origComponentInstanceProperties.add(propertyCopy);
88         });
89     }
90
91     List<InputDefinition> getOrigComponentInputs() {
92         return origComponentInputs;
93     }
94
95     void setOrigComponentInputs(List<InputDefinition> origComponentInputs) {
96         this.origComponentInputs = origComponentInputs;
97     }
98
99     Map<String, ArtifactDefinition> getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;}
100
101     Map<String, ArtifactDefinition> getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;}
102
103     void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origDeploymentArtifacts){
104         origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts;
105     }
106
107     void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origInformationalArtifacts){
108         origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts;
109     }
110
111     Map<String, List<String>> getOrigCompInstExternalRefs() {
112         return origComponentInstanceExternalRefs;
113     }
114
115     void setOrigComponentInstanceExternalRefs(Map<String, List<String>> origComponentInstanceExternalRefs) {
116         this.origComponentInstanceExternalRefs = origComponentInstanceExternalRefs;
117     }
118
119     void setVfRelationsInfo(ContainerRelationsMergeInfo containerRelationsMergeInfo) {
120         this.containerRelationsMergeInfo = containerRelationsMergeInfo;
121     }
122
123     ContainerRelationsMergeInfo getContainerRelationsMergeInfo() {
124         return containerRelationsMergeInfo;
125     }
126
127     List<CapabilityDefinition> getOrigInstanceCapabilities() {
128         return origInstanceCapabilities;
129     }
130
131     void setOrigInstanceCapabilities(List<CapabilityDefinition> origInstanceCapabilities) {
132         this.origInstanceCapabilities = origInstanceCapabilities;
133     }
134
135     Component getOrigInstanceNode() {
136         return origInstanceNode;
137     }
138
139     void setOrigInstanceNode(Component origInstanceNode) {
140         this.origInstanceNode = origInstanceNode;
141     }
142
143     Component getCurrInstanceNode() {
144         return currInstanceNode;
145     }
146
147     public void setCurrInstanceNode(Component currInstanceNode) {
148         this.currInstanceNode = currInstanceNode;
149     }
150
151     public String getOrigComponentInstId() {
152         return origComponentInstId;
153     }
154
155     public void setOrigComponentInstId(String origComponentInstId) {
156         this.origComponentInstId = origComponentInstId;
157     }
158 }