Package io.toro.martini.api
Class APIResponse
- java.lang.Object
-
- io.toro.martini.api.APIResponse
-
public class APIResponse extends Object
A simple wrapper class for REST API Responses. This is already annotated so you can simply return an instance of this class that wraps your result.
-
-
Constructor Summary
Constructors Constructor Description APIResponse()
APIResponse(APILogMessageType logLevel)
APIResponse(Object payload)
APIResponse(String message)
APIResponse(String result, String message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description APIResponse
debug(String message)
APIResponse
debugIfEnabled(String message)
APIResponse
error(String message)
APIResponse
errorIfEnabled(String message)
String
getMessage()
Object
getPayload()
String
getResult()
List<APILogMessage>
getWarnings()
APIResponse
info(String message)
APIResponse
infoIfEnabled(String message)
APIResponse
log(APILogMessageType type, String message)
APIResponse
logIfEnabled(APILogMessageType type, String message)
APIResponse
setMessage(String message)
void
setPayload(Object payload)
APIResponse
setResult(String result)
APIResponse
setWarnings(List<APILogMessage> warnings)
String
toString()
APIResponse
trace(String message)
APIResponse
traceIfEnabled(String message)
APIResponse
warn(String message)
APIResponse
warnIfEnabled(String message)
-
-
-
Constructor Detail
-
APIResponse
public APIResponse()
-
APIResponse
public APIResponse(APILogMessageType logLevel)
-
APIResponse
public APIResponse(String message)
-
APIResponse
public APIResponse(Object payload)
-
-
Method Detail
-
getResult
public String getResult()
-
setResult
public APIResponse setResult(String result)
-
getMessage
public String getMessage()
-
setMessage
public APIResponse setMessage(String message)
-
getPayload
public Object getPayload()
-
setPayload
public void setPayload(Object payload)
-
getWarnings
public List<APILogMessage> getWarnings()
-
setWarnings
public APIResponse setWarnings(List<APILogMessage> warnings)
-
log
public APIResponse log(APILogMessageType type, String message)
-
trace
public APIResponse trace(String message)
-
debug
public APIResponse debug(String message)
-
info
public APIResponse info(String message)
-
warn
public APIResponse warn(String message)
-
error
public APIResponse error(String message)
-
logIfEnabled
public APIResponse logIfEnabled(APILogMessageType type, String message)
-
traceIfEnabled
public APIResponse traceIfEnabled(String message)
-
debugIfEnabled
public APIResponse debugIfEnabled(String message)
-
infoIfEnabled
public APIResponse infoIfEnabled(String message)
-
warnIfEnabled
public APIResponse warnIfEnabled(String message)
-
errorIfEnabled
public APIResponse errorIfEnabled(String message)
-
-