Fix bug reported by SONAR.
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / consumer / OperationStatus.java
1 /**
2  *     Copyright (c) 2018 Vodafone Group
3  *
4  *     Licensed under the Apache License, Version 2.0 (the "License");
5  *     you may not use this file except in compliance with the License.
6  *     You may obtain a copy of the License at
7  *
8  *         http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *     Unless required by applicable law or agreed to in writing, software
11  *     distributed under the License is distributed on an "AS IS" BASIS,
12  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *     See the License for the specific language governing permissions and
14  *     limitations under the License.
15  */
16 package org.onap.nbi.apis.serviceorder.model.consumer;
17
18 import java.io.Serializable;
19 import java.sql.Timestamp;
20
21 public class OperationStatus implements Serializable {
22
23     /**
24      *
25      */
26     private static final long serialVersionUID = 1L;
27
28     private String serviceId = null;
29
30     private String operationId = null;
31
32     private String serviceName = null;
33
34     private String operation = null;
35
36     private String userId = null;
37
38     private String result = null;
39
40     private String operationContent = null;
41
42     private String progress = "0";
43
44     private String reason = null;
45
46     private Timestamp operateAt = null;
47
48     private Timestamp finishedAt = null;
49
50
51     public String getServiceId() {
52         return serviceId;
53     }
54
55
56     public void setServiceId(String serviceId) {
57         this.serviceId = serviceId;
58     }
59
60
61     public String getOperationId() {
62         return operationId;
63     }
64
65
66     public void setOperationId(String operationId) {
67         this.operationId = operationId;
68     }
69
70
71     public String getOperation() {
72         return operation;
73     }
74
75
76     public void setOperation(String operation) {
77         this.operation = operation;
78     }
79
80
81     public String getUserId() {
82         return userId;
83     }
84
85
86     public void setUserId(String userId) {
87         this.userId = userId;
88     }
89
90
91     public String getResult() {
92         return result;
93     }
94
95
96     public void setResult(String result) {
97         this.result = result;
98     }
99
100
101     public String getOperationContent() {
102         return operationContent;
103     }
104
105
106     public void setOperationContent(String operationContent) {
107         this.operationContent = operationContent;
108     }
109
110
111     public String getProgress() {
112         return progress;
113     }
114
115
116     public void setProgress(String progress) {
117         this.progress = progress;
118     }
119
120
121     public String getReason() {
122         return reason;
123     }
124
125
126     public void setReason(String reason) {
127         this.reason = reason;
128     }
129
130
131     public Timestamp getOperateAt() {
132         return operateAt;
133     }
134
135
136     public void setOperateAt(Timestamp operateAt) {
137         this.operateAt = operateAt;
138     }
139
140
141     public Timestamp getFinishedAt() {
142         return finishedAt;
143     }
144
145
146     public void setFinishedAt(Timestamp finishedAt) {
147         this.finishedAt = finishedAt;
148     }
149
150
151
152     /**
153      * @return Returns the serviceName.
154      */
155     public String getServiceName() {
156         return serviceName;
157     }
158
159
160
161     /**
162      * @param serviceName The serviceName to set.
163      */
164     public void setServiceName(String serviceName) {
165         this.serviceName = serviceName;
166     }
167
168
169     /**
170      * <br>
171      *
172      * @return
173      */
174     @Override
175     public int hashCode() {
176         final int prime = 31;
177         int result = 1;
178         result = prime * result + ((operationId == null) ? 0 : operationId.hashCode());
179         result = prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
180         return result;
181     }
182
183
184     /**
185      * <br>
186      *
187      * @param obj
188      * @return
189      */
190     @Override
191     public boolean equals(Object obj) {
192         if(this == obj)
193             return true;
194         if(obj == null)
195             return false;
196         if(getClass() != obj.getClass())
197             return false;
198         OperationStatus other = (OperationStatus)obj;
199         if(operationId == null) {
200             if(other.operationId != null)
201                 return false;
202         } else if(!operationId.equals(other.operationId))
203             return false;
204         if(serviceId == null) {
205             if(other.serviceId != null)
206                 return false;
207         } else if(!serviceId.equals(other.serviceId))
208             return false;
209         return true;
210     }
211
212     @Override
213     public String toString() {
214         return "OperationStatus{" +
215             "serviceId='" + serviceId + '\'' +
216             ", operationId='" + operationId + '\'' +
217             ", serviceName='" + serviceName + '\'' +
218             ", operation='" + operation + '\'' +
219             ", userId='" + userId + '\'' +
220             ", result='" + result + '\'' +
221             ", operationContent='" + operationContent + '\'' +
222             ", progress='" + progress + '\'' +
223             ", reason='" + reason + '\'' +
224             ", operateAt=" + operateAt +
225             ", finishedAt=" + finishedAt +
226             '}';
227     }
228 }