public class SimpleOAuth2Response extends Object implements OAuth2Response
throwOnError| 构造器和说明 |
|---|
SimpleOAuth2Response(org.hswebframework.expands.request.http.Response response,
ResponseConvertHandler convertHandler,
ResponseJudge responseJudge) |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
as(Class<T> type)
转换为指定的类型
|
<T> T |
as(ResponseConvert<T> convert)
自定义转换方式
|
byte[] |
asBytes() |
<T> List<T> |
asList(Class<T> type)
转换为指定类型的结果集
|
InputStream |
asStream() |
String |
asString() |
ErrorType |
getErrorType() |
void |
judgeError(ErrorType ifError,
java.util.function.Supplier<OAuth2Response> expiredCallBack) |
OAuth2Response |
onError(java.util.function.BiConsumer<OAuth2Response,ErrorType> onError)
判断是否成功,如果不成功,则抛出异常
|
int |
status() |
public SimpleOAuth2Response(org.hswebframework.expands.request.http.Response response,
ResponseConvertHandler convertHandler,
ResponseJudge responseJudge)
public void judgeError(ErrorType ifError, java.util.function.Supplier<OAuth2Response> expiredCallBack)
public InputStream asStream()
asStream 在接口中 OAuth2Responsepublic String asString()
asString 在接口中 OAuth2Responsepublic byte[] asBytes()
asBytes 在接口中 OAuth2Responsepublic <T> T as(ResponseConvert<T> convert)
OAuth2Responseas 在接口中 OAuth2ResponseT - 转换结果类型convert - 转换函数public <T> T as(Class<T> type)
OAuth2Responseas 在接口中 OAuth2ResponseT - 结果类型type - 类型Classpublic <T> List<T> asList(Class<T> type)
OAuth2ResponseasList 在接口中 OAuth2ResponseT - 结果类型type - 类型Classpublic int status()
status 在接口中 OAuth2Responsepublic OAuth2Response onError(java.util.function.BiConsumer<OAuth2Response,ErrorType> onError)
OAuth2ResponseonError 在接口中 OAuth2Responsepublic ErrorType getErrorType()
Copyright © 2018. All rights reserved.