public class ApiError
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ApiError.Builder |
Constructor and Description |
---|
ApiError(java.lang.String message) |
ApiError(java.lang.String message,
java.lang.String details) |
ApiError(java.lang.String message,
java.lang.String details,
java.lang.Object data,
java.lang.Integer error) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
asBadRequestResponseJson() |
javax.ws.rs.core.Response |
asJsonResponse() |
javax.ws.rs.core.Response |
asResponse(javax.ws.rs.core.MediaType type) |
javax.ws.rs.core.Response |
asResponse(javax.ws.rs.core.Response.Status defaultStatusIfNoErrorCodeAlready,
javax.ws.rs.core.MediaType type) |
static ApiError.Builder |
builder() |
static ApiError.Builder |
builderFromThrowable(java.lang.Throwable t) |
boolean |
equals(java.lang.Object o) |
java.lang.Object |
getData() |
java.lang.String |
getDetails() |
java.lang.Integer |
getError() |
java.lang.String |
getMessage() |
int |
hashCode() |
static ApiError |
of(java.lang.String message) |
static ApiError |
of(java.lang.Throwable t) |
java.lang.String |
toString() |
public ApiError(java.lang.String message)
public ApiError(java.lang.String message, java.lang.String details)
public ApiError(java.lang.String message, java.lang.String details, java.lang.Object data, java.lang.Integer error)
public static ApiError.Builder builder()
public static ApiError of(java.lang.Throwable t)
public static ApiError of(java.lang.String message)
public static ApiError.Builder builderFromThrowable(java.lang.Throwable t)
ApiError.Builder
whose message is initialised to either the throwable's
message or the throwable's class name if the message is null and whose details are
initialised to the throwable's stack trace.public java.lang.String getMessage()
public java.lang.String getDetails()
public java.lang.Object getData()
public java.lang.Integer getError()
public javax.ws.rs.core.Response asBadRequestResponseJson()
public javax.ws.rs.core.Response asResponse(javax.ws.rs.core.Response.Status defaultStatusIfNoErrorCodeAlready, javax.ws.rs.core.MediaType type)
public javax.ws.rs.core.Response asResponse(javax.ws.rs.core.MediaType type)
public javax.ws.rs.core.Response asJsonResponse()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object