Class Response<T>
- java.lang.Object
-
- org.gbif.api.model.common.messaging.Response<T>
-
- Direct Known Subclasses:
ResponseChain
public class Response<T> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Response.Builder<T>
Builder for Response objects.static class
Response.Status
static class
Response.StatusCode
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
Response
public Response()
-
Response
public Response(Response.Status status)
Constructor using status only.
-
Response
public Response(Response.Status status, String messageKey)
-
Response
public Response(Response.Status status, T content, String messageKey)
-
-
Method Detail
-
getContent
public T getContent()
- Returns:
- the content
-
setContent
public void setContent(T content)
- Parameters:
content
- the content to set
-
getMessage
public String getMessage()
- Returns:
- the message
-
setMessage
public void setMessage(String message)
- Parameters:
message
- the message to set
-
getMessageKey
public String getMessageKey()
- Returns:
- the messageKey
-
setMessageKey
public void setMessageKey(String messageKey)
- Parameters:
messageKey
- the messageKey to set
-
getRootException
public Throwable getRootException()
- Returns:
- rootException when the response contains an error
-
setRootException
public void setRootException(Throwable rootException)
Sets the root exception when is error response.
-
getStatus
public Response.Status getStatus()
- Returns:
- the status
-
setStatus
public void setStatus(Response.Status status)
- Parameters:
status
- the status to set
-
getStatusCode
public Integer getStatusCode()
- Returns:
- the statusCode
-
setStatusCode
public void setStatusCode(Integer statusCode)
- Parameters:
statusCode
- the statusCode to set
-
statusReason
public String statusReason()
-
-