4c3e1a6a7a6df4c963f0c2cf274eaee293461c25
[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 @SuppressWarnings("CheckStyle")
26 public class ComputeFlavor {
27
28   private int num_cpus;
29   private String disk_size;
30   private String mem_size;
31
32   public int getNum_cpus() {
33     return num_cpus;
34   }
35
36   public void setNum_cpus(int num_cpus) {
37     this.num_cpus = num_cpus;
38   }
39
40   public String getDisk_size() {
41     return disk_size;
42   }
43
44   public void setDisk_size(String disk_size) {
45     this.disk_size = disk_size;
46   }
47
48   public String getMem_size() {
49     return mem_size;
50   }
51
52   public void setMem_size(String mem_size) {
53     this.mem_size = mem_size;
54   }
55
56   @Override
57   public String toString() {
58     return "ComputeFlavor{ num_cpus=" + num_cpus + ", disk_size= " + disk_size
59         + ", mem_size=" + mem_size + "}";
60   }
61
62   @Override
63   public boolean equals(Object obj) {
64     if (this == obj)
65       return true;
66     if (obj == null || getClass() != obj.getClass())
67       return false;
68     ComputeFlavor other = (ComputeFlavor) obj;
69
70       if (num_cpus != other.num_cpus)
71         return false;
72       if (this.disk_size == null) {
73         if (other.disk_size != null)
74           return false;
75       } else if (!disk_size.equals(other.disk_size))
76         return false;
77       if (this.mem_size == null) {
78         if (other.mem_size != null)
79           return false;
80       } else if (!mem_size.equals(other.mem_size))
81         return false;
82
83     return true;
84   }
85
86   @Override
87   public int hashCode() {
88     int result = num_cpus;
89     result = 31 * result + (disk_size != null ? disk_size.hashCode() : 0);
90     result = 31 * result + (mem_size != null ? mem_size.hashCode() : 0);
91     return result;
92   }
93 }