[VID-3] Setting docker image tag
[vid.git] / vid / src / main / java / org / openecomp / vid / mso / MsoResponseWrapper.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.vid.mso;
22
23 import com.fasterxml.jackson.annotation.JsonInclude;
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
26 import org.apache.commons.lang.builder.ToStringBuilder;
27
28 /**
29  * This wrapper encapsulates the MSO response in the format expected by the pages.
30  */
31 @JsonInclude(JsonInclude.Include.NON_NULL)
32 @JsonPropertyOrder({
33             "status",
34             "entity"
35 })
36
37 public class MsoResponseWrapper  {
38         
39         /** The status. */
40         @JsonProperty("status")
41         private int status;
42         
43         /** The entity. */
44         @JsonProperty("entity")
45         private String entity;
46         
47         /**
48          * Gets the entity.
49          *
50          * @return the entity
51          */
52         @JsonProperty("entity")
53     public String getEntity() {
54         return entity;
55     }
56
57         /**
58          * Gets the status.
59          *
60          * @return the status
61          */
62         @JsonProperty("status")
63     public int getStatus() {
64         return status;
65     }
66         
67         /**
68          * Sets the status.
69          *
70          * @param v the new status
71          */
72         @JsonProperty("status")
73     public void setStatus(int v) {
74         this.status = v;
75     }
76         
77         /**
78          * Sets the entity.
79          *
80          * @param v the new entity
81          */
82         @JsonProperty("entity")
83     public void setEntity(String v) {
84         this.entity = v;
85     }
86     
87     /* (non-Javadoc)
88      * @see java.lang.Object#toString()
89      */
90     @Override
91     public String toString() {
92         return ToStringBuilder.reflectionToString(this);
93     }
94     
95     /**
96      * Gets the response.
97      *
98      * @return the response
99      */
100     public String getResponse () {
101         
102         StringBuilder b = new StringBuilder ("{ \"status\": ");
103         b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
104         return (b.toString());
105     }
106     
107 }