031eaec23fb9e4002a038bf7aa4213292643d5d9
[vid.git] / vid-app-common / src / main / java / org / onap / vid / mso / rest / RequestStatus.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 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.onap.vid.mso.rest;
22
23 import com.fasterxml.jackson.annotation.*;
24 import org.apache.commons.lang.builder.EqualsBuilder;
25 import org.apache.commons.lang.builder.HashCodeBuilder;
26 import org.apache.commons.lang.builder.ToStringBuilder;
27
28 import java.util.HashMap;
29 import java.util.Map;
30
31
32 /**
33  * fields describing the status of a request
34  * 
35  */
36 @JsonInclude(JsonInclude.Include.NON_NULL)
37 @JsonPropertyOrder({
38     "percentProgress",
39     "requestState",
40     "statusMessage",
41     "timestamp",
42     "wasRolledBack"
43 })
44 public class RequestStatus {
45
46     /**
47      * percentage complete estimate from 0 to 100
48      * 
49      */
50     @JsonProperty("percentProgress")
51     private Double percentProgress;
52     /**
53      * short description of the instantiation state
54      * (Required)
55      * 
56      */
57     @JsonProperty("requestState")
58     private String requestState;
59     /**
60      * additional descriptive information about the status
61      * 
62      */
63     @JsonProperty("statusMessage")
64     private String statusMessage;
65     /**
66      * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
67      * (Required)
68      * 
69      */
70     @JsonProperty("timestamp")
71     private String timestamp;
72     /**
73      * true or false boolean indicating whether the request was rolled back
74      * 
75      */
76     @JsonProperty("wasRolledBack")
77     private Boolean wasRolledBack;
78     @JsonIgnore
79     private Map<String, Object> additionalProperties = new HashMap<>();
80
81     /**
82      * percentage complete estimate from 0 to 100
83      * 
84      * @return
85      *     The percentProgress
86      */
87     @JsonProperty("percentProgress")
88     public Double getPercentProgress() {
89         return percentProgress;
90     }
91
92     /**
93      * percentage complete estimate from 0 to 100
94      * 
95      * @param percentProgress
96      *     The percentProgress
97      */
98     @JsonProperty("percentProgress")
99     public void setPercentProgress(Double percentProgress) {
100         this.percentProgress = percentProgress;
101     }
102
103     /**
104      * short description of the instantiation state
105      * (Required)
106      * 
107      * @return
108      *     The requestState
109      */
110     @JsonProperty("requestState")
111     public String getRequestState() {
112         return requestState;
113     }
114
115     /**
116      * short description of the instantiation state
117      * (Required)
118      * 
119      * @param requestState
120      *     The requestState
121      */
122     @JsonProperty("requestState")
123     public void setRequestState(String requestState) {
124         this.requestState = requestState;
125     }
126
127     /**
128      * additional descriptive information about the status
129      * 
130      * @return
131      *     The statusMessage
132      */
133     @JsonProperty("statusMessage")
134     public String getStatusMessage() {
135         return statusMessage;
136     }
137
138     /**
139      * additional descriptive information about the status
140      * 
141      * @param statusMessage
142      *     The statusMessage
143      */
144     @JsonProperty("statusMessage")
145     public void setStatusMessage(String statusMessage) {
146         this.statusMessage = statusMessage;
147     }
148
149     /**
150      * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
151      * (Required)
152      * 
153      * @return
154      *     The timestamp
155      */
156     @JsonProperty("timestamp")
157     public String getTimestamp() {
158         return timestamp;
159     }
160
161     /**
162      * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
163      * (Required)
164      * 
165      * @param timestamp
166      *     The timestamp
167      */
168     @JsonProperty("timestamp")
169     public void setTimestamp(String timestamp) {
170         this.timestamp = timestamp;
171     }
172
173     /**
174      * true or false boolean indicating whether the request was rolled back
175      * 
176      * @return
177      *     The wasRolledBack
178      */
179     @JsonProperty("wasRolledBack")
180     public Boolean getWasRolledBack() {
181         return wasRolledBack;
182     }
183
184     /**
185      * true or false boolean indicating whether the request was rolled back
186      * 
187      * @param wasRolledBack
188      *     The wasRolledBack
189      */
190     @JsonProperty("wasRolledBack")
191     public void setWasRolledBack(Boolean wasRolledBack) {
192         this.wasRolledBack = wasRolledBack;
193     }
194
195     @Override
196     public String toString() {
197         return ToStringBuilder.reflectionToString(this);
198     }
199
200     @JsonAnyGetter
201     public Map<String, Object> getAdditionalProperties() {
202         return this.additionalProperties;
203     }
204
205     @JsonAnySetter
206     public void setAdditionalProperty(String name, Object value) {
207         this.additionalProperties.put(name, value);
208     }
209
210     @Override
211     public int hashCode() {
212         return new HashCodeBuilder().append(percentProgress).append(requestState).append(statusMessage).append(timestamp).append(wasRolledBack).append(additionalProperties).toHashCode();
213     }
214
215     @Override
216     public boolean equals(Object other) {
217         if (other == this) {
218             return true;
219         }
220         if (!(other instanceof RequestStatus)) {
221             return false;
222         }
223         RequestStatus rhs = ((RequestStatus) other);
224         return new EqualsBuilder().append(percentProgress, rhs.percentProgress).append(requestState, rhs.requestState).append(statusMessage, rhs.statusMessage).append(timestamp, rhs.timestamp).append(wasRolledBack, rhs.wasRolledBack).append(additionalProperties, rhs.additionalProperties).isEquals();
225     }
226
227 }