Class HandlerResponse
java.lang.Object
ch.autumo.beetroot.handler.HandlerResponse
Handler response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHandler state: not OK.static final intHandler state: OK.static final intHandler state: warning.static final intResponse type: file download.static final intResponse type: file upload.static final intResponse type: form. -
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 TypeMethodDescriptionReturns the download file value.Returns the download file mime type value.Returns the download file name value.Returns the exception value.org.nanohttpd.protocols.http.response.ResponseReturns the http response value.intgetId()Returns the id value.Returns the message value.Returns the object value.intReturns the saved id value.intReturns the status value.getTitle()Returns the title value.intgetType()Returns the type value.voidsetDownloadFile(File downloadFile) Sets the download file value.voidsetDownloadFileMimeType(String downloadFileMimeType) Sets the download file mime type value.voidsetDownloadFileName(String downloadFileName) Sets the download file name value.voidsetException(Exception exception) Sets the exception value.voidsetId(int id) Sets the id value.voidsetMessage(String message) Sets the message value.voidSets the object value.voidsetSavedId(int savedId) Sets the saved id value.voidsetStatus(int status) Sets the status value.voidSets the title value.voidsetType(int type) Sets the type value.
-
Field Details
-
STATE_NOT_OK
public static final int STATE_NOT_OKHandler state: not OK.- See Also:
-
STATE_OK
public static final int STATE_OKHandler state: OK.- See Also:
-
STATE_WARNING
public static final int STATE_WARNINGHandler state: warning.- See Also:
-
TYPE_FORM
public static final int TYPE_FORMResponse type: form.- See Also:
-
TYPE_FILE_UPLOAD
public static final int TYPE_FILE_UPLOADResponse type: file upload.- See Also:
-
TYPE_FILE_DOWNLOAD
public static final int TYPE_FILE_DOWNLOADResponse 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
-
HandlerResponse
-
HandlerResponse
-
-
Method Details
-
getId
public int getId()Returns the id value.- Returns:
- the id value
-
setId
public void setId(int id) Sets the id value.- Parameters:
id- the new id value
-
getStatus
public int getStatus()Returns the status value.- Returns:
- the status value
-
setStatus
public void setStatus(int status) Sets the status value.- Parameters:
status- the new status value
-
getHttpResponse
public org.nanohttpd.protocols.http.response.Response getHttpResponse()Returns the http response value.- Returns:
- the http response value
-
getTitle
-
setTitle
-
getMessage
-
setMessage
Sets the message value.- Parameters:
message- the new message value
-
getException
-
setException
Sets the exception value.- Parameters:
exception- the new exception value
-
getObject
-
setObject
Sets the object value.- Parameters:
object- the new object value
-
getType
public int getType()Returns the type value.- Returns:
- the type value
-
setType
public void setType(int type) Sets the type value.- Parameters:
type- the new type value
-
getDownloadFile
-
setDownloadFile
Sets the download file value.- Parameters:
downloadFile- the new download file value
-
getDownloadFileName
Returns the download file name value.- Returns:
- the download file name value
-
setDownloadFileName
Sets the download file name value.- Parameters:
downloadFileName- the new download file name value
-
getDownloadFileMimeType
Returns the download file mime type value.- Returns:
- the download file mime type value
-
setDownloadFileMimeType
Sets the download file mime type value.- Parameters:
downloadFileMimeType- the new download file mime type value
-
getSavedId
public int getSavedId()Returns the saved id value.- Returns:
- the saved id value
-
setSavedId
public void setSavedId(int savedId) Sets the saved id value.- Parameters:
savedId- the new saved id value
-