4372e7f98ad263251ce7f202da5f74d501b5cff9
[sdc.git] /
1 package org.openecomp.sdc.generator.datatypes.tosca;
2
3 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
4
5 import java.util.List;
6 import java.util.Map;
7
8 public class VspModelInfo {
9   private String releaseVendor;
10   //Map of component id and name
11   private Map<String, String> components;
12   //Map of part number and deployment flavor model
13   private Map<String, DeploymentFlavorModel> allowedFlavors;
14   //Map of component id and images
15   private Map<String, List<MultiFlavorVfcImage>> multiFlavorVfcImages;
16   //Map of component and ports (NICs)
17   private Map<String, List<Nic>> nics;
18
19   public String getReleaseVendor() {
20     return releaseVendor;
21   }
22
23   public void setReleaseVendor(String releaseVendor) {
24     this.releaseVendor = releaseVendor;
25   }
26
27   public Map<String, String> getComponents() {
28     return components;
29   }
30
31   public void setComponents(Map<String, String> components) {
32     this.components = components;
33   }
34
35   public Map<String, DeploymentFlavorModel> getAllowedFlavors() {
36     return allowedFlavors;
37   }
38
39   public void setAllowedFlavors(Map<String, DeploymentFlavorModel> allowedFlavors) {
40     this.allowedFlavors = allowedFlavors;
41   }
42
43   public Map<String, List<MultiFlavorVfcImage>> getMultiFlavorVfcImages() {
44     return multiFlavorVfcImages;
45   }
46
47   public void setMultiFlavorVfcImages(Map<String, List<MultiFlavorVfcImage>> multiFlavorVfcImages) {
48     this.multiFlavorVfcImages = multiFlavorVfcImages;
49   }
50
51   public Map<String, List<Nic>> getNics() {
52     return nics;
53   }
54
55   public void setNics(Map<String, List<Nic>> nics) {
56     this.nics = nics;
57   }
58
59   @Override
60   public int hashCode() {
61     int result = releaseVendor != null ? releaseVendor.hashCode() : 0;
62     result = 31 * result + (components != null ? components.hashCode() : 0);
63     result = 31 * result + (allowedFlavors != null ? allowedFlavors.hashCode() : 0);
64     result = 31 * result + (multiFlavorVfcImages != null ? multiFlavorVfcImages.hashCode() : 0);
65     result = 31 * result + (nics != null ? nics.hashCode() : 0);
66     return result;
67   }
68
69   @Override
70   public String toString() {
71     return "VspModelInfo{"
72        + "releaseVendor='" + releaseVendor + '\''
73        + ", components=" + components
74        + ", allowedFlavors=" + allowedFlavors
75        + ", multiFlavorVfcImages=" + multiFlavorVfcImages
76        + ", nics=" + nics
77        + '}';
78   }
79
80   @Override
81   public boolean equals(Object obj) {
82     if (this == obj) {
83       return true;
84     }
85     if (obj != null && getClass() != obj.getClass()) {
86       return false;
87     }
88     VspModelInfo other = (VspModelInfo) obj;
89     if(other != null) {
90       if (this.releaseVendor == null) {
91         if (other.releaseVendor != null) {
92           return false;
93         }
94       } else if (!releaseVendor.equals(other.releaseVendor)) {
95         return false;
96       }
97       if (this.components == null) {
98         if (other.components != null) {
99           return false;
100         }
101       } else if (!components.equals(other.components)) {
102         return false;
103       }
104       if (this.allowedFlavors == null) {
105         if (other.allowedFlavors != null) {
106           return false;
107         }
108       } else if (!allowedFlavors.equals(other.allowedFlavors)) {
109         return false;
110       }
111       if (this.multiFlavorVfcImages == null) {
112         if (other.multiFlavorVfcImages != null) {
113           return false;
114         }
115       } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) {
116         return false;
117       }
118       if (this.multiFlavorVfcImages == null) {
119         if (other.multiFlavorVfcImages != null) {
120           return false;
121         }
122       } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) {
123         return false;
124       }
125       if (this.nics == null) {
126         if (other.nics != null) {
127           return false;
128         }
129       } else if (!nics.equals(other.nics)) {
130         return false;
131       }
132     }
133     return true;
134   }
135 }