Class Problem

    • Constructor Detail

      • Problem

        public Problem​(JSON problem,
                       URL baseUrl)
        Creates a new Problem object.
        Parameters:
        problem - Problem as JSON structure
        baseUrl - Document's base URL to resolve relative URIs against
    • Method Detail

      • getType

        public URI getType()
        Returns the problem type. It is always an absolute URI.
      • getTitle

        @CheckForNull
        public String getTitle()
        Returns a short, human-readable summary of the problem. The text may be localized if supported by the server. null if the server did not provide a title.
        See Also:
        toString()
      • getDetail

        @CheckForNull
        public String getDetail()
        Returns a detailed and specific human-readable explanation of the problem. The text may be localized if supported by the server.
        See Also:
        toString()
      • getInstance

        @CheckForNull
        public URI getInstance()
        Returns an URI that identifies the specific occurence of the problem. It is always an absolute URI.
      • asJSON

        public JSON asJSON()
        Returns the problem as JSON object, to access other fields.
        Returns:
        Problem as JSON object
      • toString

        public String toString()
        Returns a human-readable description of the problem, that is as specific as possible. The description may be localized if supported by the server.

        If getSubProblems() exist, they will be appended.

        Technically, it returns getDetail(). If not set, getTitle() is returned instead. As a last resort, getType() is returned.

        Overrides:
        toString in class Object