Class HttpResponseException.Builder

  • Enclosing class:
    HttpResponseException

    public static class HttpResponseException.Builder
    extends java.lang.Object
    Builder.

    Implementation is not thread safe.

    Since:
    1.14
    • Field Detail

      • statusCode

        int statusCode
        HTTP status code.
      • statusMessage

        java.lang.String statusMessage
        Status message or null.
      • content

        java.lang.String content
        Response content or null for none.
      • message

        java.lang.String message
        Detail message to use or null for none.
      • attemptCount

        int attemptCount
        Number of attempts performed
    • Constructor Detail

      • Builder

        public Builder​(int statusCode,
                       java.lang.String statusMessage,
                       HttpHeaders headers)
        Parameters:
        statusCode - HTTP status code
        statusMessage - status message or null
        headers - HTTP headers
      • Builder

        public Builder​(HttpResponse response)
        Parameters:
        response - HTTP response
    • Method Detail

      • getMessage

        public final java.lang.String getMessage()
        Returns the detail message to use or null for none.
      • setMessage

        public HttpResponseException.Builder setMessage​(java.lang.String message)
        Sets the detail message to use or null for none.

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

      • getStatusCode

        public final int getStatusCode()
        Returns the HTTP status code or 0 for none.
      • setStatusCode

        public HttpResponseException.Builder setStatusCode​(int statusCode)
        Sets the HTTP status code or 0 for none.

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

      • getStatusMessage

        public final java.lang.String getStatusMessage()
        Returns the HTTP status message or null for none.
      • setStatusMessage

        public HttpResponseException.Builder setStatusMessage​(java.lang.String statusMessage)
        Sets the HTTP status message or null for none.

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

      • getHeaders

        public HttpHeaders getHeaders()
        Returns the HTTP response headers.
      • setHeaders

        public HttpResponseException.Builder setHeaders​(HttpHeaders headers)
        Sets the HTTP response headers.

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

      • getContent

        public final java.lang.String getContent()
        Returns the HTTP response content or null for none.
      • setContent

        public HttpResponseException.Builder setContent​(java.lang.String content)
        Sets the HTTP response content or null for none.

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

      • getAttemptCount

        public final int getAttemptCount()
        Returns the request attempt count
      • setAttemptCount

        public HttpResponseException.Builder setAttemptCount​(int attemptCount)
        Sets the attempt count for the related HTTP request execution.