Class ErrorResponse


  • public class ErrorResponse
    extends java.lang.Object
    Error message response class to be serialzed to Json and returned from the ControllerExceptionHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorResponse()  
      ErrorResponse​(java.lang.String message)  
      ErrorResponse​(java.lang.String message, java.util.Map<java.lang.String,​java.lang.Object> otherProperties)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addProperty​(java.lang.String key, java.lang.Object value)
      Add an additional map property to be serialized to JSON
      java.lang.String getMessage()
      Get the message for this response
      java.util.Map<java.lang.String,​java.lang.Object> getOtherProperties()
      Get the other properties defined in the map
      void setMessage​(java.lang.String message)
      Set the message for this response
      void setOtherProperties​(java.util.Map<java.lang.String,​java.lang.Object> otherProperties)
      Set the additional properties to display for this response
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorResponse

        public ErrorResponse()
      • ErrorResponse

        public ErrorResponse​(java.lang.String message)
      • ErrorResponse

        public ErrorResponse​(java.lang.String message,
                             java.util.Map<java.lang.String,​java.lang.Object> otherProperties)
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Get the message for this response
        Returns:
        the message for this response
      • setMessage

        public void setMessage​(java.lang.String message)
        Set the message for this response
        Parameters:
        message - the message for this response
      • addProperty

        public void addProperty​(java.lang.String key,
                                java.lang.Object value)
        Add an additional map property to be serialized to JSON
        Parameters:
        key - the key of the additional property
        value - the value of the additional property
      • getOtherProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getOtherProperties()
        Get the other properties defined in the map
        Returns:
        the other properties defined in the map
      • setOtherProperties

        public void setOtherProperties​(java.util.Map<java.lang.String,​java.lang.Object> otherProperties)
        Set the additional properties to display for this response
        Parameters:
        otherProperties - the additional properties to display for this message.