e34627d62b0fca6f5bcf97f3685d79a8ebda5d02
[sdc.git] /
1 package org.openecomp.sdc.generator.datatypes.tosca;
2
3 @SuppressWarnings("CheckStyle")
4 public class ComputeFlavor {
5
6   private int num_cpus;
7   private String disk_size;
8   private String mem_size;
9
10   public int getNum_cpus() {
11     return num_cpus;
12   }
13
14   public void setNum_cpus(int num_cpus) {
15     this.num_cpus = num_cpus;
16   }
17
18   public String getDisk_size() {
19     return disk_size;
20   }
21
22   public void setDisk_size(String disk_size) {
23     this.disk_size = disk_size;
24   }
25
26   public String getMem_size() {
27     return mem_size;
28   }
29
30   public void setMem_size(String mem_size) {
31     this.mem_size = mem_size;
32   }
33
34   @Override
35   public String toString() {
36     return "ComputeFlavor{ num_cpus=" + num_cpus + ", disk_size= " + disk_size
37         + ", mem_size=" + mem_size + "}";
38   }
39
40   @Override
41   public boolean equals(Object obj) {
42     if (this == obj)
43       return true;
44     if (obj != null && getClass() != obj.getClass())
45       return false;
46     ComputeFlavor other = (ComputeFlavor) obj;
47     if(other != null) {
48       if (num_cpus != other.num_cpus)
49         return false;
50       if (this.disk_size == null) {
51         if (other.disk_size != null)
52           return false;
53       } else if (!disk_size.equals(other.disk_size))
54         return false;
55       if (this.mem_size == null) {
56         if (other.mem_size != null)
57           return false;
58       } else if (!mem_size.equals(other.mem_size))
59         return false;
60     }
61     return true;
62   }
63
64   @Override
65   public int hashCode() {
66     int result = num_cpus;
67     result = 31 * result + (disk_size != null ? disk_size.hashCode() : 0);
68     result = 31 * result + (mem_size != null ? mem_size.hashCode() : 0);
69     return result;
70   }
71 }