com.github.df.restypass.http.pojo.FailedResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resty-pass Show documentation
Show all versions of resty-pass Show documentation
High-Performance Restful Client Library
The newest version!
package com.github.df.restypass.http.pojo;
import com.github.df.restypass.exception.execute.RestyException;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.cookie.Cookie;
import org.asynchttpclient.Response;
import org.asynchttpclient.uri.Uri;
import java.io.InputStream;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.List;
/**
* 失败的响应
* Created by darrenfu on 17-7-25.
*/
public class FailedResponse implements Response {
/**
* Resty异常
*/
private RestyException exception;
private FailedResponse(RestyException exception) {
this.exception = exception;
}
/**
* Create failed response.
*
* @param ex the ex
* @return the failed response
*/
public static FailedResponse create(RestyException ex) {
return new FailedResponse(ex);
}
/**
* Is failed response boolean.
*
* @param response the response
* @return the boolean
*/
public static boolean isFailedResponse(Response response) {
return response instanceof FailedResponse;
}
/**
* Gets exception.
*
* @return the exception
*/
public RestyException getException() {
return this.exception;
}
@Override
public int getStatusCode() {
return 500;
}
@Override
public String getStatusText() {
return null;
}
@Override
public byte[] getResponseBodyAsBytes() {
return new byte[0];
}
@Override
public ByteBuffer getResponseBodyAsByteBuffer() {
return null;
}
@Override
public InputStream getResponseBodyAsStream() {
return null;
}
@Override
public String getResponseBody(Charset charset) {
return null;
}
@Override
public String getResponseBody() {
return null;
}
@Override
public Uri getUri() {
return null;
}
@Override
public String getContentType() {
return null;
}
@Override
public String getHeader(CharSequence charSequence) {
return null;
}
@Override
public List getHeaders(CharSequence charSequence) {
return null;
}
@Override
public HttpHeaders getHeaders() {
return null;
}
@Override
public boolean isRedirected() {
return false;
}
@Override
public List getCookies() {
return null;
}
@Override
public boolean hasResponseStatus() {
return false;
}
@Override
public boolean hasResponseHeaders() {
return false;
}
@Override
public boolean hasResponseBody() {
return false;
}
@Override
public SocketAddress getRemoteAddress() {
return null;
}
@Override
public SocketAddress getLocalAddress() {
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy