2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.adapters.vfc.model;
26 * The Unified Restful Reponse Class <br>
31 * @version ONAP Amsterdam Release 2017-09-06
33 public class RestfulResponse {
35 // the response content
36 private String responseContent;
38 // the response status
41 // the response header
42 private Map<String, String> respHeaderMap;
44 public RestfulResponse() {
47 this.respHeaderMap = null;
50 public int getStatus() {
54 public void setStatus(int status) {
58 public Map<String, String> getRespHeaderMap() {
59 return this.respHeaderMap;
62 public void setRespHeaderMap(Map<String, String> header) {
63 this.respHeaderMap = header;
66 public int getRespHeaderInt(String key) {
67 if (this.respHeaderMap != null) {
68 String result = this.respHeaderMap.get(key);
70 return Integer.parseInt(result);
76 public long getRespHeaderLong(String key) {
77 if (this.respHeaderMap != null) {
78 String result = this.respHeaderMap.get(key);
80 return Long.parseLong(result);
86 public String getRespHeaderStr(String key) {
87 if (this.respHeaderMap != null) {
88 return this.respHeaderMap.get(key);
93 public String getResponseContent() {
94 return this.responseContent;
97 public void setResponseContent(String responseString) {
98 this.responseContent = responseString;