Package ch.autumo.beetroot.handler
Class HandlerResponse
java.lang.Object
ch.autumo.beetroot.handler.HandlerResponse
Handler response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionHandlerResponse(int status) Handler with as status.HandlerResponse(int status, int savedId) Handler with status and a DB ID of a just created record.HandlerResponse(int status, String message) Handler with status and a message to show.HandlerResponse(int status, String title, String message) Handler with status, title and a message to show.HandlerResponse(int status, String title, String message, Exception exception) Handler with status, title, message and an exception to show.HandlerResponse(int status, String title, String message, Exception exception, Object object) Handler with status, title, message and an exception to show and an additional object.HandlerResponse(int status, org.nanohttpd.protocols.http.response.Response httpResponse) Handler with a pre-created HTTP response. -
Method Summary
Modifier and TypeMethodDescriptionorg.nanohttpd.protocols.http.response.ResponseintgetId()intintgetTitle()intgetType()voidsetDownloadFile(File downloadFile) voidsetDownloadFileMimeType(String downloadFileMimeType) voidsetDownloadFileName(String downloadFileName) voidsetException(Exception exception) voidsetId(int id) voidsetMessage(String message) voidvoidsetSavedId(int savedId) voidsetStatus(int status) voidvoidsetType(int type)
-
Field Details
-
STATE_NOT_OK
public static final int STATE_NOT_OK- See Also:
-
STATE_OK
public static final int STATE_OK- See Also:
-
STATE_WARNING
public static final int STATE_WARNING- See Also:
-
TYPE_FORM
public static final int TYPE_FORM- See Also:
-
TYPE_FILE_UPLOAD
public static final int TYPE_FILE_UPLOAD- See Also:
-
TYPE_FILE_DOWNLOAD
public static final int TYPE_FILE_DOWNLOAD- See Also:
-
-
Constructor Details
-
HandlerResponse
public HandlerResponse(int status) Handler with as status.- Parameters:
status- status
-
HandlerResponse
public HandlerResponse(int status, org.nanohttpd.protocols.http.response.Response httpResponse) Handler with a pre-created HTTP response.- Parameters:
status- statushttpResponse- HTTP response
-
HandlerResponse
public HandlerResponse(int status, int savedId) Handler with status and a DB ID of a just created record.- Parameters:
status- statussavedId- save ID
-
HandlerResponse
Handler with status and a message to show.- Parameters:
status- statusmessage- message
-
HandlerResponse
Handler with status, title and a message to show.- Parameters:
status- statustitle- titlemessage- message
-
HandlerResponse
Handler with status, title, message and an exception to show.- Parameters:
status- statustitle- titlemessage- messageexception- exception
-
HandlerResponse
public HandlerResponse(int status, String title, String message, Exception exception, Object object) Handler with status, title, message and an exception to show and an additional object.- Parameters:
status- statustitle- titlemessage- messageexception- exceptionobject- object
-
-
Method Details
-
getId
public int getId() -
setId
public void setId(int id) -
getStatus
public int getStatus() -
setStatus
public void setStatus(int status) -
getHttpResponse
public org.nanohttpd.protocols.http.response.Response getHttpResponse() -
getTitle
-
setTitle
-
getMessage
-
setMessage
-
getException
-
setException
-
getObject
-
setObject
-
getType
public int getType() -
setType
public void setType(int type) -
getDownloadFile
-
setDownloadFile
-
getDownloadFileName
-
setDownloadFileName
-
getDownloadFileMimeType
-
setDownloadFileMimeType
-
getSavedId
public int getSavedId() -
setSavedId
public void setSavedId(int savedId)
-