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