27cfc961e5bc2895dec19a0d2949612dfb50b1df
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / consumer / RequestStatus.java
1 /**
2  *     Copyright (c) 2018 Orange
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.util.Objects;
19
20 public class RequestStatus {
21
22     private RequestState requestState;
23
24     private int percentProgress;
25
26     public RequestStatus(RequestState requestState, int percentProgress) {
27         this.requestState = requestState;
28         this.percentProgress = percentProgress;
29     }
30
31     public RequestStatus() {}
32
33     public RequestState getRequestState() {
34         return requestState;
35     }
36
37     public void setRequestState(RequestState requestState) {
38         this.requestState = requestState;
39     }
40
41     public int getPercentProgress() {
42         return percentProgress;
43     }
44
45     public void setPercentProgress(int percentProgress) {
46         this.percentProgress = percentProgress;
47     }
48
49     @Override
50     public boolean equals(Object o) {
51         if (this == o)
52             return true;
53         if (o == null || getClass() != o.getClass())
54             return false;
55         RequestStatus that = (RequestStatus) o;
56         return percentProgress == that.percentProgress && requestState == that.requestState;
57     }
58
59     @Override
60     public int hashCode() {
61         return Objects.hash(requestState, percentProgress);
62     }
63
64     @Override
65     public String toString() {
66         return "RequestStatus{" + "requestState=" + requestState + ", percentProgress=" + percentProgress + '}';
67     }
68 }