Class HttpResponse

  • public class HttpResponse
    extends java.lang.Object
    • Field Summary

      Modifier and Type Field Description
      static java.lang.String HTTP_TARGET_HOST  
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      M addHeader​(java.lang.String name, java.lang.String value)  
      java.lang.Object getAttribute​(java.lang.String key)
      Retrieves a user-defined attribute of this message.
      java.lang.Iterable<java.lang.String> getAttributeNames()  
      java.util.function.Supplier<> getContent()  
      java.nio.charset.Charset getContentEncoding()  
      java.lang.String getHeader​(java.lang.String name)  
      java.lang.Iterable<java.lang.String> getHeaderNames()  
      java.lang.Iterable<java.lang.String> getHeaders​(java.lang.String name)  
      int getStatus()  
      java.lang.String getTargetHost()
      Returns the host this response was received from, or null if it was not set.
      boolean isSuccessful()  
      M removeAttribute​(java.lang.String key)  
      M removeHeader​(java.lang.String name)  
      M setAttribute​(java.lang.String key, java.lang.Object value)  
      M setContent​(java.util.function.Supplier<> supplier)  
      M setHeader​(java.lang.String name, java.lang.String value)  
      HttpResponse setStatus​(int status)  
      HttpResponse setTargetHost​(java.lang.String host)
      Sets the host this response was received from.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail


        public static final java.lang.String HTTP_TARGET_HOST
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpResponse

        public HttpResponse()
    • Method Detail

      • isSuccessful

        public boolean isSuccessful()
      • getStatus

        public int getStatus()
      • setTargetHost

        public HttpResponse setTargetHost​(java.lang.String host)
        Sets the host this response was received from.
        host - originating host
      • getTargetHost

        public java.lang.String getTargetHost()
        Returns the host this response was received from, or null if it was not set.
        originating host
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String key)
        Retrieves a user-defined attribute of this message. Attributes are stored as simple key-value pairs and are not included in a message's serialized form.
        key - attribute name
        attribute object
      • setAttribute

        public M setAttribute​(java.lang.String key,
                              java.lang.Object value)
      • removeAttribute

        public M removeAttribute​(java.lang.String key)
      • getAttributeNames

        public java.lang.Iterable<java.lang.String> getAttributeNames()
      • getHeaderNames

        public java.lang.Iterable<java.lang.String> getHeaderNames()
      • getHeaders

        public java.lang.Iterable<java.lang.String> getHeaders​(java.lang.String name)
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
      • setHeader

        public M setHeader​(java.lang.String name,
                           java.lang.String value)
      • addHeader

        public M addHeader​(java.lang.String name,
                           java.lang.String value)
      • removeHeader

        public M removeHeader​(java.lang.String name)
      • getContentEncoding

        public java.nio.charset.Charset getContentEncoding()
      • setContent

        public M setContent​(java.util.function.Supplier<> supplier)
      • getContent

        public java.util.function.Supplier<> getContent()