re base code
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / upgrade / ServiceInfo.java
1 package org.openecomp.sdc.be.components.upgrade;
2
3 import org.openecomp.sdc.be.dao.api.ActionStatus;
4
5 public class ServiceInfo {
6     private String uniqueId;
7     private String version;
8     private String name;
9     private ActionStatus status;
10  
11     public ServiceInfo(){
12         status = ActionStatus.OK;
13     }
14     
15     public ServiceInfo(String id, ActionStatus status){
16         this.uniqueId = id;
17         this.status = status;
18     }
19     public String getUniqueId() {
20         return uniqueId;
21     }
22     public void setUniqueId(String uniqueId) {
23         this.uniqueId = uniqueId;
24     }
25     public String getVersion() {
26         return version;
27     }
28     public void setVersion(String version) {
29         this.version = version;
30     }
31     public String getName() {
32         return name;
33     }
34     public void setName(String name) {
35         this.name = name;
36     }
37     public ActionStatus getStatus() {
38         return status;
39     }
40     public void setStatus(ActionStatus status) {
41         this.status = status;
42     }
43
44     @Override
45     public int hashCode() {
46         final int prime = 31;
47         int result = 1;
48         result = prime * result + ((name == null) ? 0 : name.hashCode());
49         result = prime * result + ((status == null) ? 0 : status.hashCode());
50         result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
51         result = prime * result + ((version == null) ? 0 : version.hashCode());
52         return result;
53     }
54
55     @Override
56     public boolean equals(Object obj) {
57         if (this == obj)
58             return true;
59         if (obj == null)
60             return false;
61         if (getClass() != obj.getClass())
62             return false;
63         ServiceInfo other = (ServiceInfo) obj;
64         if (name == null) {
65             if (other.name != null)
66                 return false;
67         } else if (!name.equals(other.name))
68             return false;
69         if (status != other.status)
70             return false;
71         if (uniqueId == null) {
72             if (other.uniqueId != null)
73                 return false;
74         } else if (!uniqueId.equals(other.uniqueId))
75             return false;
76         if (version == null) {
77             if (other.version != null)
78                 return false;
79         } else if (!version.equals(other.version))
80             return false;
81         return true;
82     }
83     
84 }