Merge "Reorder modifiers"
[so.git] / adapters / mso-vfc-adapter / src / main / java / org / openecomp / mso / adapters / vfc / model / RestfulResponse.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 package org.openecomp.mso.adapters.vfc.model;\r
21 \r
22 import java.util.Map;\r
23 \r
24 /**\r
25  * The Unified Restful Reponse Class\r
26  * <br>\r
27  * <p>\r
28  * </p>\r
29  * \r
30  * @author\r
31  * @version     ONAP Amsterdam Release  2017-09-06\r
32  */\r
33 public class RestfulResponse {\r
34 \r
35     // the response content\r
36     private String responseContent;\r
37 \r
38     //the response status\r
39     private int status;\r
40 \r
41     //the response header\r
42     private Map<String, String> respHeaderMap;\r
43 \r
44     public RestfulResponse() {\r
45         this.status = -1;\r
46 \r
47         this.respHeaderMap = null;\r
48     }\r
49 \r
50     public int getStatus() {\r
51         return this.status;\r
52     }\r
53 \r
54     public void setStatus(int status) {\r
55         this.status = status;\r
56     }\r
57 \r
58     public Map<String, String> getRespHeaderMap() {\r
59         return this.respHeaderMap;\r
60     }\r
61 \r
62     public void setRespHeaderMap(Map<String, String> header) {\r
63         this.respHeaderMap = header;\r
64     }\r
65 \r
66     public int getRespHeaderInt(String key) {\r
67         if(this.respHeaderMap != null) {\r
68             String result = this.respHeaderMap.get(key);\r
69             if(result != null) {\r
70                 return Integer.parseInt(result);\r
71             }\r
72         }\r
73         return -1;\r
74     }\r
75 \r
76     public long getRespHeaderLong(String key) {\r
77         if(this.respHeaderMap != null) {\r
78             String result = this.respHeaderMap.get(key);\r
79             if(result != null) {\r
80                 return Long.parseLong(result);\r
81             }\r
82         }\r
83         return -1L;\r
84     }\r
85 \r
86     public String getRespHeaderStr(String key) {\r
87         if(this.respHeaderMap != null) {\r
88             return this.respHeaderMap.get(key);\r
89         }\r
90         return null;\r
91     }\r
92 \r
93     public String getResponseContent() {\r
94         return this.responseContent;\r
95     }\r
96 \r
97     public void setResponseContent(String responseString) {\r
98         this.responseContent = responseString;\r
99     }\r
100 }\r