2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.vid.mso.rest;
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;
28 import java.util.HashMap;
33 * fields describing the status of a request
36 @JsonInclude(JsonInclude.Include.NON_NULL)
44 public class RequestStatus {
46 public RequestStatus() {}
48 public RequestStatus(String requestState, String statusMessage, String timestamp) {
49 this.requestState = requestState;
50 this.statusMessage = statusMessage;
51 this.timestamp = timestamp;
53 public RequestStatus(String requestState, String statusMessage, String timestamp, String flowStatus) {
54 this.requestState = requestState;
55 this.statusMessage = statusMessage;
56 this.timestamp = timestamp;
57 this.flowStatus = flowStatus;
61 * short description of the flow status
65 @JsonProperty("flowStatus")
66 private String flowStatus;
70 * percentage complete estimate from 0 to 100
73 @JsonProperty("percentProgress")
74 private Double percentProgress;
76 * short description of the instantiation state
80 @JsonProperty("requestState")
81 private String requestState;
83 * additional descriptive information about the status
86 @JsonProperty("statusMessage")
87 private String statusMessage;
89 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
93 @JsonProperty("timestamp")
94 private String timestamp;
96 * true or false boolean indicating whether the request was rolled back
99 @JsonProperty("wasRolledBack")
100 private Boolean wasRolledBack;
102 private Map<String, Object> additionalProperties = new HashMap<>();
105 * percentage complete estimate from 0 to 100
108 * The percentProgress
110 @JsonProperty("percentProgress")
111 public Double getPercentProgress() {
112 return percentProgress;
116 * percentage complete estimate from 0 to 100
118 * @param percentProgress
119 * The percentProgress
121 @JsonProperty("percentProgress")
122 public void setPercentProgress(Double percentProgress) {
123 this.percentProgress = percentProgress;
127 * short description of the instantiation state
133 @JsonProperty("requestState")
134 public String getRequestState() {
139 * short description of the instantiation state
142 * @param requestState
145 @JsonProperty("requestState")
146 public void setRequestState(String requestState) {
147 this.requestState = requestState;
151 * additional descriptive information about the status
156 @JsonProperty("statusMessage")
157 public String getStatusMessage() {
158 return statusMessage;
162 * additional descriptive information about the status
164 * @param statusMessage
167 @JsonProperty("statusMessage")
168 public void setStatusMessage(String statusMessage) {
169 this.statusMessage = statusMessage;
173 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
179 @JsonProperty("timestamp")
180 public String getTimestamp() {
185 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
191 @JsonProperty("timestamp")
192 public void setTimestamp(String timestamp) {
193 this.timestamp = timestamp;
197 * true or false boolean indicating whether the request was rolled back
202 @JsonProperty("wasRolledBack")
203 public Boolean getWasRolledBack() {
204 return wasRolledBack;
208 * true or false boolean indicating whether the request was rolled back
210 * @param wasRolledBack
213 @JsonProperty("wasRolledBack")
214 public void setWasRolledBack(Boolean wasRolledBack) {
215 this.wasRolledBack = wasRolledBack;
219 public String toString() {
220 return ToStringBuilder.reflectionToString(this);
224 public Map<String, Object> getAdditionalProperties() {
225 return this.additionalProperties;
229 public void setAdditionalProperty(String name, Object value) {
230 this.additionalProperties.put(name, value);
234 * additional descriptive information about the status
239 @JsonProperty("flowStatus")
240 public String getFlowStatus() {
245 * additional descriptive information about the status
250 @JsonProperty("flowStatus")
251 public void setFlowStatus(String flowStatus) {
252 this.flowStatus = flowStatus;
256 public int hashCode() {
257 return new HashCodeBuilder().append(percentProgress).append(requestState).append(statusMessage).append(timestamp).append(wasRolledBack).append(additionalProperties).toHashCode();
261 public boolean equals(Object other) {
265 if (!(other instanceof RequestStatus)) {
268 RequestStatus rhs = ((RequestStatus) other);
269 return new EqualsBuilder().append(percentProgress, rhs.percentProgress).append(requestState, rhs.requestState).append(statusMessage, rhs.statusMessage).append(timestamp, rhs.timestamp).append(wasRolledBack, rhs.wasRolledBack).append(flowStatus, rhs.flowStatus).append(additionalProperties, rhs.additionalProperties).isEquals();