Added oparent to sdc main
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / upgrade / ServiceInfo.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.be.components.upgrade;
22
23 import org.openecomp.sdc.be.dao.api.ActionStatus;
24
25 public class ServiceInfo {
26     private String uniqueId;
27     private String version;
28     private String name;
29     private ActionStatus status;
30  
31     public ServiceInfo(){
32         status = ActionStatus.OK;
33     }
34     
35     public ServiceInfo(String id, ActionStatus status){
36         this.uniqueId = id;
37         this.status = status;
38     }
39     public String getUniqueId() {
40         return uniqueId;
41     }
42     public void setUniqueId(String uniqueId) {
43         this.uniqueId = uniqueId;
44     }
45     public String getVersion() {
46         return version;
47     }
48     public void setVersion(String version) {
49         this.version = version;
50     }
51     public String getName() {
52         return name;
53     }
54     public void setName(String name) {
55         this.name = name;
56     }
57     public ActionStatus getStatus() {
58         return status;
59     }
60     public void setStatus(ActionStatus status) {
61         this.status = status;
62     }
63
64     @Override
65     public int hashCode() {
66         final int prime = 31;
67         int result = 1;
68         result = prime * result + ((name == null) ? 0 : name.hashCode());
69         result = prime * result + ((status == null) ? 0 : status.hashCode());
70         result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
71         result = prime * result + ((version == null) ? 0 : version.hashCode());
72         return result;
73     }
74
75     @Override
76     public boolean equals(Object obj) {
77         if (this == obj)
78             return true;
79         if (obj == null)
80             return false;
81         if (getClass() != obj.getClass())
82             return false;
83         ServiceInfo other = (ServiceInfo) obj;
84         if (name == null) {
85             if (other.name != null)
86                 return false;
87         } else if (!name.equals(other.name))
88             return false;
89         if (status != other.status)
90             return false;
91         if (uniqueId == null) {
92             if (other.uniqueId != null)
93                 return false;
94         } else if (!uniqueId.equals(other.uniqueId))
95             return false;
96         if (version == null) {
97             if (other.version != null)
98                 return false;
99         } else if (!version.equals(other.version))
100             return false;
101         return true;
102     }
103     
104 }