| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.plugin.link.applinks.RemoteResponse<T>
T - the type of entity stored in the responsepublic class RemoteResponse<T>
Represents a response from a remote resource, e.g. REST, XMLRPC.
| Constructor Summary | |
|---|---|
| RemoteResponse(T entity,
               ErrorCollection errors,
               com.atlassian.sal.api.net.Response response) | |
| RemoteResponse(T entity,
               com.atlassian.sal.api.net.Response response) | |
| Method Summary | ||
|---|---|---|
|  boolean | containsErrorWithText(String... text)Checks if any of the error messages contain all of the elements in the text list. | |
| static
 | credentialsRequired(com.atlassian.sal.api.net.Response response)Creates a RemoteResponse for when the endpoint requires authentication, but no credentials are available. | |
|  T | getEntity() | |
|  ErrorCollection | getErrors()Returns the ErrorCollection from the response entity. | |
|  int | getStatusCode() | |
|  String | getStatusText() | |
|  boolean | hasErrors()Returns true if the response entity was a non-empty ErrorCollection, false if otherwise. | |
|  boolean | isSuccessful() | |
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public RemoteResponse(@Nullable
                      T entity,
                      @Nullable
                      ErrorCollection errors,
                      com.atlassian.sal.api.net.Response response)
public RemoteResponse(@Nullable
                      T entity,
                      com.atlassian.sal.api.net.Response response)
| Method Detail | 
|---|
public T getEntity()
public boolean hasErrors()
public ErrorCollection getErrors()
public boolean containsErrorWithText(String... text)
text - an array of snippets to check for in the error message
public int getStatusCode()
public String getStatusText()
public boolean isSuccessful()
public static <E> RemoteResponse<E> credentialsRequired(com.atlassian.sal.api.net.Response response)
response - response requiring authentication
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||