group.rxcloud.capa.component.http.HttpResponse Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package group.rxcloud.capa.component.http;
import java.util.Map;
/**
* {@link CapaHttp} HTTP Client Response Struct.
*
* @param the Actual response data type.
*/
public class HttpResponse {
private final T body;
private final Map headers;
private final int statusCode;
/**
* Represents an http response.
*
* @param body The body of the http response.
* @param headers The headers of the http response.
* @param statusCode The status code of the http response.
*/
public HttpResponse(T body, Map headers, int statusCode) {
this.body = body;
this.headers = headers;
this.statusCode = statusCode;
}
/**
* Gets actual response data.
*
* @return
*/
public T getBody() {
return body;
}
/**
* Gets http headers.
*
* @return
*/
public Map getHeaders() {
return headers;
}
/**
* Gets http invocation status code.
*
* @return
*/
public int getStatusCode() {
return statusCode;
}
}