ed51456e81e3d3746aaa5a017b4f6e8f178df8fa
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / scheduler / policy / PolicyResponseWrapper.java
1 package org.openecomp.portalapp.portal.scheduler.policy;
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 Policy response
10  */
11 @JsonInclude(JsonInclude.Include.NON_NULL)
12 @JsonPropertyOrder({
13             "status",
14             "entity"
15 })
16
17 public class PolicyResponseWrapper {
18         
19         @JsonProperty("status")
20         private int status;
21
22         @JsonProperty("entity")
23         private String entity;
24
25         @JsonProperty("entity")
26     public String getEntity() {
27         return entity;
28     }
29         
30         @JsonProperty("status")
31     public int getStatus() {
32         return status;
33     }   
34         
35         @JsonProperty("status")
36     public void setStatus(int v) {
37         this.status = v;
38     }
39
40         @JsonProperty("entity")
41     public void setEntity(String v) {
42         this.entity = v;
43     }
44
45     @Override
46     public String toString() {
47         return ToStringBuilder.reflectionToString(this);
48     }
49
50     public String getResponse () {
51         
52         StringBuilder b = new StringBuilder ("{ \"status\": ");
53         b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
54         return (b.toString());
55     }
56 }