Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-vfc-adapter / src / main / java / org / onap / so / adapters / vfc / model / RestfulResponse.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.onap.so.adapters.vfc.model;
22
23 import java.util.Map;
24
25 /**
26  * The Unified Restful Reponse Class <br>
27  * <p>
28  * </p>
29  * 
30  * @author
31  * @version ONAP Amsterdam Release 2017-09-06
32  */
33 public class RestfulResponse {
34
35     // the response content
36     private String responseContent;
37
38     // the response status
39     private int status;
40
41     // the response header
42     private Map<String, String> respHeaderMap;
43
44     public RestfulResponse() {
45         this.status = -1;
46
47         this.respHeaderMap = null;
48     }
49
50     public int getStatus() {
51         return this.status;
52     }
53
54     public void setStatus(int status) {
55         this.status = status;
56     }
57
58     public Map<String, String> getRespHeaderMap() {
59         return this.respHeaderMap;
60     }
61
62     public void setRespHeaderMap(Map<String, String> header) {
63         this.respHeaderMap = header;
64     }
65
66     public int getRespHeaderInt(String key) {
67         if (this.respHeaderMap != null) {
68             String result = this.respHeaderMap.get(key);
69             if (result != null) {
70                 return Integer.parseInt(result);
71             }
72         }
73         return -1;
74     }
75
76     public long getRespHeaderLong(String key) {
77         if (this.respHeaderMap != null) {
78             String result = this.respHeaderMap.get(key);
79             if (result != null) {
80                 return Long.parseLong(result);
81             }
82         }
83         return -1L;
84     }
85
86     public String getRespHeaderStr(String key) {
87         if (this.respHeaderMap != null) {
88             return this.respHeaderMap.get(key);
89         }
90         return null;
91     }
92
93     public String getResponseContent() {
94         return this.responseContent;
95     }
96
97     public void setResponseContent(String responseString) {
98         this.responseContent = responseString;
99     }
100 }