Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions...
If you think the Android project etalio-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright 2014 Ericsson AB//www.java2s.com
*
* Licensed 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 com.etalio.android.client;
import com.etalio.android.client.exception.EtalioHttpException;
import java.util.Map;
/**
* Wrapper for HTTP response
*/publicclass HttpResponse<T> {
privatefinalint status;
privatefinal String reason;
privatefinal Map<String, String> headers;
privatefinal T body;
public HttpResponse(int status, String reason, Map<String, String> headers, T body) throws EtalioHttpException {
if (status < 200) {
thrownew EtalioHttpException(status, reason + ": status code < 200", null);
}
if (reason == null) {
thrownew EtalioHttpException(status, reason + ": reason == null", null);
}
if (headers == null) {
thrownew EtalioHttpException(status, reason + ": headers == null", null);
}
this.status = status;
this.reason = reason;
this.headers = headers;
this.body = body;
}
publicint getStatus() {
return status;
}
public String getReason() {
return reason;
}
public Map<String, String> getHeaders() {
return headers;
}
public T getBody() {
return body;
}
}