All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yuweix.kuafu.http.response.ErrorHttpResponse Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.yuweix.kuafu.http.response;


import com.yuweix.kuafu.core.json.JsonUtil;
import org.apache.http.Header;
import javax.servlet.http.Cookie;
import java.util.List;


/**
 * @author yuwei
 */
public class ErrorHttpResponse implements HttpResponse {
	private int status;
	private String errorMessage;

	public ErrorHttpResponse(int status, String errorMessage) {
		this.status = status;
		this.errorMessage = errorMessage;
	}

	@Override
	public boolean isSuccess() {
		return false;
	}
	@Override
	public int getStatus() {
		return status;
	}
	@Override
	public B getBody() {
		return null;
	}
	@Override
	public List getCookieList() {
		return null;
	}
	@Override
	public List
getHeaderList() { return null; } @Override public String getErrorMessage() { return errorMessage; } @Override public String getContentType() { return null; } @Override public String toString() { return JsonUtil.toJSONString(this); } }