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