d30f05688cbe0428505f7749a51854b19517068f
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / scheduler / SchedulerResponseWrapper.java
1 package org.openecomp.portalapp.portal.scheduler;
2
3 import com.fasterxml.jackson.annotation.JsonInclude;
4 import com.fasterxml.jackson.annotation.JsonProperty;
5 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
6 import org.apache.commons.lang.builder.ToStringBuilder;
7
8 /**
9  * This wrapper encapsulates the Scheduler response
10  */
11 @JsonInclude(JsonInclude.Include.NON_NULL)
12 @JsonPropertyOrder({
13             "status",
14             "entity",
15             "uuid"
16 })
17
18 public class SchedulerResponseWrapper {
19         
20         @JsonProperty("status")
21         private int status;
22
23         @JsonProperty("entity")
24         private String entity;
25         
26         @JsonProperty("uuid")
27         private String uuid;
28
29         @JsonProperty("entity")
30     public String getEntity() {
31         return entity;
32     }
33         
34         @JsonProperty("status")
35     public int getStatus() {
36         return status;
37     }
38         
39         @JsonProperty("uuid")
40     public String getUuid() {
41         return uuid;
42     }   
43         
44         @JsonProperty("status")
45     public void setStatus(int v) {
46         this.status = v;
47     }
48
49         @JsonProperty("entity")
50     public void setEntity(String v) {
51         this.entity = v;
52     }
53         
54         @JsonProperty("uuid")
55     public void setUuid(String v) {
56         this.uuid = v;
57     }   
58
59     @Override
60     public String toString() {
61         return ToStringBuilder.reflectionToString(this);
62     }
63
64     public String getResponse () {
65         
66         StringBuilder b = new StringBuilder ("{ \"status\": ");
67         b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
68         return (b.toString());
69     }
70
71 }