public class Response<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Response.Builder<T>
Builder for Response objects.
|
static class |
Response.Status |
static class |
Response.StatusCode |
Constructor and Description |
---|
Response() |
Response(Response.Status status)
Constructor using status only.
|
Response(Response.Status status,
String messageKey) |
Response(Response.Status status,
T content,
String messageKey) |
Response(Response<T> response) |
Modifier and Type | Method and Description |
---|---|
void |
copyTo(Response<?> response) |
T |
getContent() |
String |
getMessage() |
String |
getMessageKey() |
Throwable |
getRootException() |
Response.Status |
getStatus() |
Integer |
getStatusCode() |
void |
setContent(T content) |
void |
setMessage(String message) |
void |
setMessageKey(String messageKey) |
void |
setRootException(Throwable rootException)
Sets the root exception when is error response.
|
void |
setStatus(Response.Status status) |
void |
setStatusCode(Integer statusCode) |
String |
statusReason() |
String |
toString() |
public Response()
public Response(Response.Status status)
public Response(Response.Status status, String messageKey)
public Response(Response.Status status, T content, String messageKey)
public T getContent()
public void setContent(T content)
content
- the content to setpublic String getMessage()
public void setMessage(String message)
message
- the message to setpublic String getMessageKey()
public void setMessageKey(String messageKey)
messageKey
- the messageKey to setpublic Throwable getRootException()
public void setRootException(Throwable rootException)
public Response.Status getStatus()
public void setStatus(Response.Status status)
status
- the status to setpublic Integer getStatusCode()
public void setStatusCode(Integer statusCode)
statusCode
- the statusCode to setpublic String statusReason()
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.