T
- the type of entity stored in the responsepublic class RemoteResponse<T> extends Object
Constructor and Description |
---|
RemoteResponse(T entity,
ErrorCollection errors,
com.atlassian.sal.api.net.Response response) |
RemoteResponse(T entity,
com.atlassian.sal.api.net.Response response) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsErrorWithText(String... text)
Checks if any of the error messages contain all of the elements in the text list.
|
static <E> RemoteResponse<E> |
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() |
void |
setStatusCode(int statusCode) |
void |
setSuccessful(boolean success) |
String |
toString() |
public RemoteResponse(@Nullable T entity, @Nullable ErrorCollection errors, com.atlassian.sal.api.net.Response response)
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 messagepublic int getStatusCode()
public String getStatusText()
public boolean isSuccessful()
public static <E> RemoteResponse<E> credentialsRequired(com.atlassian.sal.api.net.Response response)
response
- response requiring authenticationpublic void setStatusCode(int statusCode)
public void setSuccessful(boolean success)
Copyright © 2002-2019 Atlassian. All Rights Reserved.