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