T - public class APIResponse<T> extends Object
APIResponse>가 return type인 method는 exception을 throw 하지 않습니다.
api call에 대한 성공 여부 판단은 isSuccess() 메소드로 확인하실 수 있고,
1. 실패시의 exception내용을 받고 싶으면 getRestApiClientException()를 호출하시거나 getMessage() 등을 확인하실 수 있습니다.
2. 발생한 exception을 그대로 위로 throw 하시려면 #orThrow()를
3. exception시 default 값을 리턴하고 싶으시면 #or({value})를 호출 하실 수 있습니다.
| Modifier and Type | Class and Description |
|---|---|
static class |
APIResponse.RestAPIException |
| Modifier | Constructor and Description |
|---|---|
protected |
APIResponse() |
| Modifier and Type | Method and Description |
|---|---|
String |
getApiUrl() |
Object[] |
getArgs() |
int |
getCode() |
T |
getContents() |
static <S> APIResponse<S> |
getInstance(Exception e) |
static <S> APIResponse<S> |
getInstance(String apiUrl,
Object[] args,
Exception e) |
static <S> APIResponse<S> |
getInstance(String apiUrl,
Object[] args,
S contents) |
String |
getMessage() |
APIResponse.RestAPIException |
getRestApiClientException() |
boolean |
isSuccess() |
T |
or(T defaultValue) |
T |
orThrow() |
String |
toString() |
public int getCode()
public String getMessage()
public T getContents()
public APIResponse.RestAPIException getRestApiClientException()
public String getApiUrl()
public Object[] getArgs()
public static <S> APIResponse<S> getInstance(Exception e)
public static <S> APIResponse<S> getInstance(String apiUrl, Object[] args, Exception e)
public static <S> APIResponse<S> getInstance(String apiUrl, Object[] args, S contents)
public T orThrow()
public boolean isSuccess()
Copyright © 2016. All Rights Reserved.