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 {
47 * percentage complete estimate from 0 to 100
50 @JsonProperty("percentProgress")
51 private Double percentProgress;
53 * short description of the instantiation state
57 @JsonProperty("requestState")
58 private String requestState;
60 * additional descriptive information about the status
63 @JsonProperty("statusMessage")
64 private String statusMessage;
66 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
70 @JsonProperty("timestamp")
71 private String timestamp;
73 * true or false boolean indicating whether the request was rolled back
76 @JsonProperty("wasRolledBack")
77 private Boolean wasRolledBack;
79 private Map<String, Object> additionalProperties = new HashMap<>();
82 * percentage complete estimate from 0 to 100
87 @JsonProperty("percentProgress")
88 public Double getPercentProgress() {
89 return percentProgress;
93 * percentage complete estimate from 0 to 100
95 * @param percentProgress
98 @JsonProperty("percentProgress")
99 public void setPercentProgress(Double percentProgress) {
100 this.percentProgress = percentProgress;
104 * short description of the instantiation state
110 @JsonProperty("requestState")
111 public String getRequestState() {
116 * short description of the instantiation state
119 * @param requestState
122 @JsonProperty("requestState")
123 public void setRequestState(String requestState) {
124 this.requestState = requestState;
128 * additional descriptive information about the status
133 @JsonProperty("statusMessage")
134 public String getStatusMessage() {
135 return statusMessage;
139 * additional descriptive information about the status
141 * @param statusMessage
144 @JsonProperty("statusMessage")
145 public void setStatusMessage(String statusMessage) {
146 this.statusMessage = statusMessage;
150 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
156 @JsonProperty("timestamp")
157 public String getTimestamp() {
162 * GMT Datetime the requestStatus was created e.g.: Wed, 15 Oct 2014 13:01:52 GMT
168 @JsonProperty("timestamp")
169 public void setTimestamp(String timestamp) {
170 this.timestamp = timestamp;
174 * true or false boolean indicating whether the request was rolled back
179 @JsonProperty("wasRolledBack")
180 public Boolean getWasRolledBack() {
181 return wasRolledBack;
185 * true or false boolean indicating whether the request was rolled back
187 * @param wasRolledBack
190 @JsonProperty("wasRolledBack")
191 public void setWasRolledBack(Boolean wasRolledBack) {
192 this.wasRolledBack = wasRolledBack;
196 public String toString() {
197 return ToStringBuilder.reflectionToString(this);
201 public Map<String, Object> getAdditionalProperties() {
202 return this.additionalProperties;
206 public void setAdditionalProperty(String name, Object value) {
207 this.additionalProperties.put(name, value);
211 public int hashCode() {
212 return new HashCodeBuilder().append(percentProgress).append(requestState).append(statusMessage).append(timestamp).append(wasRolledBack).append(additionalProperties).toHashCode();
216 public boolean equals(Object other) {
220 if (!(other instanceof RequestStatus)) {
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();