public class ApiError
extends java.lang.Object
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) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
asBadRequestResponseJson() |
javax.ws.rs.core.Response |
asResponse(javax.ws.rs.core.Response.Status status,
javax.ws.rs.core.MediaType type) |
static ApiError.Builder |
builder() |
static ApiError.Builder |
builderFromThrowable(java.lang.Throwable t) |
boolean |
equals(java.lang.Object other) |
static ApiError.Builder |
fromThrowable(java.lang.Throwable t)
Deprecated.
since 0.7.0; use
builderFromThrowable(Throwable) |
java.lang.String |
getDetails() |
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 static ApiError.Builder builder()
public static ApiError of(java.lang.Throwable t)
public static ApiError of(java.lang.String message)
@Deprecated public static ApiError.Builder fromThrowable(java.lang.Throwable t)
builderFromThrowable(Throwable)
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 boolean equals(java.lang.Object other)
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
public javax.ws.rs.core.Response asBadRequestResponseJson()
public javax.ws.rs.core.Response asResponse(javax.ws.rs.core.Response.Status status, javax.ws.rs.core.MediaType type)