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