Class HandlerResponse

java.lang.Object
ch.autumo.beetroot.handler.HandlerResponse

public class HandlerResponse extends Object
Handler response.
  • Field Details

    • STATE_NOT_OK

      public static final int STATE_NOT_OK
      Handler state: not OK.
      See Also:
    • STATE_OK

      public static final int STATE_OK
      Handler state: OK.
      See Also:
    • STATE_WARNING

      public static final int STATE_WARNING
      Handler state: warning.
      See Also:
    • TYPE_FORM

      public static final int TYPE_FORM
      Response type: form.
      See Also:
    • TYPE_FILE_UPLOAD

      public static final int TYPE_FILE_UPLOAD
      Response type: file upload.
      See Also:
    • TYPE_FILE_DOWNLOAD

      public static final int TYPE_FILE_DOWNLOAD
      Response 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 - status
      httpResponse - HTTP response
    • HandlerResponse

      public HandlerResponse(int status, int savedId)
      Handler with status and a DB ID of a just created record.
      Parameters:
      status - status
      savedId - save ID
    • HandlerResponse

      public HandlerResponse(int status, String message)
      Handler with status and a message to show.
      Parameters:
      status - status
      message - message
    • HandlerResponse

      public HandlerResponse(int status, String title, String message)
      Handler with status, title and a message to show.
      Parameters:
      status - status
      title - title
      message - message
    • HandlerResponse

      public HandlerResponse(int status, String title, String message, Exception exception)
      Handler with status, title, message and an exception to show.
      Parameters:
      status - status
      title - title
      message - message
      exception - 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 - status
      title - title
      message - message
      exception - exception
      object - object
  • 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

      public String getTitle()
      Returns the title value.
      Returns:
      the title value
    • setTitle

      public void setTitle(String title)
      Sets the title value.
      Parameters:
      title - the new title value
    • getMessage

      public String getMessage()
      Returns the message value.
      Returns:
      the message value
    • setMessage

      public void setMessage(String message)
      Sets the message value.
      Parameters:
      message - the new message value
    • getException

      public Exception getException()
      Returns the exception value.
      Returns:
      the exception value
    • setException

      public void setException(Exception exception)
      Sets the exception value.
      Parameters:
      exception - the new exception value
    • getObject

      public Object getObject()
      Returns the object value.
      Returns:
      the object value
    • setObject

      public void setObject(Object object)
      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

      public File getDownloadFile()
      Returns the download file value.
      Returns:
      the download file value
    • setDownloadFile

      public void setDownloadFile(File downloadFile)
      Sets the download file value.
      Parameters:
      downloadFile - the new download file value
    • getDownloadFileName

      public String getDownloadFileName()
      Returns the download file name value.
      Returns:
      the download file name value
    • setDownloadFileName

      public void setDownloadFileName(String downloadFileName)
      Sets the download file name value.
      Parameters:
      downloadFileName - the new download file name value
    • getDownloadFileMimeType

      public String getDownloadFileMimeType()
      Returns the download file mime type value.
      Returns:
      the download file mime type value
    • setDownloadFileMimeType

      public void setDownloadFileMimeType(String downloadFileMimeType)
      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