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;
55 * percentage complete estimate from 0 to 100
58 @JsonProperty("percentProgress")
59 private Double percentProgress;
61 * short description of the instantiation state
65 @JsonProperty("requestState")
66 private String requestState;
68 * additional descriptive information about the status
71 @JsonProperty("statusMessage")
72 private String statusMessage;
74 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
78 @JsonProperty("timestamp")
79 private String timestamp;
81 * true or false boolean indicating whether the request was rolled back
84 @JsonProperty("wasRolledBack")
85 private Boolean wasRolledBack;
87 private Map<String, Object> additionalProperties = new HashMap<>();
90 * percentage complete estimate from 0 to 100
95 @JsonProperty("percentProgress")
96 public Double getPercentProgress() {
97 return percentProgress;
101 * percentage complete estimate from 0 to 100
103 * @param percentProgress
104 * The percentProgress
106 @JsonProperty("percentProgress")
107 public void setPercentProgress(Double percentProgress) {
108 this.percentProgress = percentProgress;
112 * short description of the instantiation state
118 @JsonProperty("requestState")
119 public String getRequestState() {
124 * short description of the instantiation state
127 * @param requestState
130 @JsonProperty("requestState")
131 public void setRequestState(String requestState) {
132 this.requestState = requestState;
136 * additional descriptive information about the status
141 @JsonProperty("statusMessage")
142 public String getStatusMessage() {
143 return statusMessage;
147 * additional descriptive information about the status
149 * @param statusMessage
152 @JsonProperty("statusMessage")
153 public void setStatusMessage(String statusMessage) {
154 this.statusMessage = statusMessage;
158 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
164 @JsonProperty("timestamp")
165 public String getTimestamp() {
170 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
176 @JsonProperty("timestamp")
177 public void setTimestamp(String timestamp) {
178 this.timestamp = timestamp;
182 * true or false boolean indicating whether the request was rolled back
187 @JsonProperty("wasRolledBack")
188 public Boolean getWasRolledBack() {
189 return wasRolledBack;
193 * true or false boolean indicating whether the request was rolled back
195 * @param wasRolledBack
198 @JsonProperty("wasRolledBack")
199 public void setWasRolledBack(Boolean wasRolledBack) {
200 this.wasRolledBack = wasRolledBack;
204 public String toString() {
205 return ToStringBuilder.reflectionToString(this);
209 public Map<String, Object> getAdditionalProperties() {
210 return this.additionalProperties;
214 public void setAdditionalProperty(String name, Object value) {
215 this.additionalProperties.put(name, value);
219 public int hashCode() {
220 return new HashCodeBuilder().append(percentProgress).append(requestState).append(statusMessage).append(timestamp).append(wasRolledBack).append(additionalProperties).toHashCode();
224 public boolean equals(Object other) {
228 if (!(other instanceof RequestStatus)) {
231 RequestStatus rhs = ((RequestStatus) other);
232 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();