Class DefaultErrorResponseEntity


  • public class DefaultErrorResponseEntity
    extends Object
    Standardized error response following RFC-7807 format
    • Constructor Detail

      • DefaultErrorResponseEntity

        public DefaultErrorResponseEntity()
    • Method Detail

      • detail

        public DefaultErrorResponseEntity detail​(String detail)
        A human-readable explanation specific to this occurrence of the problem.
        Parameters:
        detail -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getDetail

        public String getDetail()
        A human-readable explanation specific to this occurrence of the problem.
        Returns:
        detail
      • setDetail

        public void setDetail​(String detail)
        A human-readable explanation specific to this occurrence of the problem.
        Parameters:
        detail -
      • errorCode

        public DefaultErrorResponseEntity errorCode​(String errorCode)
        Unique business error code.
        Parameters:
        errorCode -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getErrorCode

        public String getErrorCode()
        Unique business error code.
        Returns:
        errorCode
      • setErrorCode

        public void setErrorCode​(String errorCode)
        Unique business error code.
        Parameters:
        errorCode -
      • instance

        public DefaultErrorResponseEntity instance​(String instance)
        A URI that identifies the specific occurrence of the problem if applicable.
        Parameters:
        instance -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getInstance

        public String getInstance()
        A URI that identifies the specific occurrence of the problem if applicable.
        Returns:
        instance
      • setInstance

        public void setInstance​(String instance)
        A URI that identifies the specific occurrence of the problem if applicable.
        Parameters:
        instance -
      • invalidFields

        public DefaultErrorResponseEntity invalidFields​(List<InvalidField> invalidFields)
        Array of fields with validation errors when applicable.
        Parameters:
        invalidFields -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getInvalidFields

        public List<InvalidField> getInvalidFields()
        Array of fields with validation errors when applicable.
        Returns:
        invalidFields
      • setInvalidFields

        public void setInvalidFields​(List<InvalidField> invalidFields)
        Array of fields with validation errors when applicable.
        Parameters:
        invalidFields -
      • requestId

        public DefaultErrorResponseEntity requestId​(String requestId)
        The unique reference for the request.
        Parameters:
        requestId -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getRequestId

        public String getRequestId()
        The unique reference for the request.
        Returns:
        requestId
      • setRequestId

        public void setRequestId​(String requestId)
        The unique reference for the request.
        Parameters:
        requestId -
      • status

        public DefaultErrorResponseEntity status​(Integer status)
        The HTTP status code.
        Parameters:
        status -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getStatus

        public Integer getStatus()
        The HTTP status code.
        Returns:
        status
      • setStatus

        public void setStatus​(Integer status)
        The HTTP status code.
        Parameters:
        status -
      • title

        public DefaultErrorResponseEntity title​(String title)
        A short, human-readable summary of the problem type.
        Parameters:
        title -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getTitle

        public String getTitle()
        A short, human-readable summary of the problem type.
        Returns:
        title
      • setTitle

        public void setTitle​(String title)
        A short, human-readable summary of the problem type.
        Parameters:
        title -
      • type

        public DefaultErrorResponseEntity type​(String type)
        A URI that identifies the validation error type. It points to human-readable documentation for the problem type.
        Parameters:
        type -
        Returns:
        the current DefaultErrorResponseEntity instance, allowing for method chaining
      • getType

        public String getType()
        A URI that identifies the validation error type. It points to human-readable documentation for the problem type.
        Returns:
        type
      • setType

        public void setType​(String type)
        A URI that identifies the validation error type. It points to human-readable documentation for the problem type.
        Parameters:
        type -
      • equals

        public boolean equals​(Object o)
        Return true if this DefaultErrorResponseEntity object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • fromJson

        public static DefaultErrorResponseEntity fromJson​(String jsonString)
                                                   throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of DefaultErrorResponseEntity given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of DefaultErrorResponseEntity
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to DefaultErrorResponseEntity
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of DefaultErrorResponseEntity to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException