Class Status


  • public class Status
    extends Object
    For every status response, there is only one message returned. This means the server will fail fast and won't return multiple message at all. Two benefits for this design:

    1. low latency as server will return the first error without further processing 2. limited attack risks and make the error handling harder to analyzed

    Author:
    Steve Hu
    • Constructor Detail

      • Status

        public Status()
        Default construction that is only used in reflection.
      • Status

        public Status​(String code,
                      Object... args)
        Construct a status object based on error code and a list of arguments. It is the most popular way to create status object from status.yml definition.
        Parameters:
        code - Error Code
        args - A list of arguments that will be populated into the error description
      • Status

        public Status​(int statusCode,
                      String code,
                      String message,
                      String description)
        Construct a status object based on all the properties in the object. It is not very often to use this construct to create object.
        Parameters:
        statusCode - Status Code
        code - Code
        message - Message
        description - Description
      • Status

        public Status​(int statusCode,
                      String code,
                      String message,
                      String description,
                      String severity)
        Construct a status object based on all the properties in the object. It is not very often to use this construct to create object.
        Parameters:
        statusCode - Status Code
        code - Code
        severity - Status Severity
        message - Message
        description - Description
    • Method Detail

      • getStatusCode

        public int getStatusCode()
      • setStatusCode

        public void setStatusCode​(int statusCode)
      • getCode

        public String getCode()
      • setCode

        public void setCode​(String code)
      • getMessage

        public String getMessage()
      • setMessage

        public void setMessage​(String message)
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String description)
      • setSeverity

        public void setSeverity​(String severity)
      • getSeverity

        public String getSeverity()