Class ForwardedHeader.Hop

  • Enclosing class:
    ForwardedHeader

    public static class ForwardedHeader.Hop
    extends Object
    This class represents a request's hop detail.
    • Constructor Detail

      • Hop

        public Hop​(String forDirective,
                   String byDirective,
                   String hostDirective,
                   String protoDirective)
        Construct a ForwardedHeader.Hop. Each field may contain double quotes.
        Parameters:
        forDirective - the client's address
        byDirective - the proxy's address
        hostDirective - the host requested at this time
        protoDirective - the protocol used between the client and the proxy
      • Hop

        public Hop​(String hopDetails)
        Construct a ForwardedHeader.Hop.
        Parameters:
        hopDetails - the hop details as one long http key value list. eg : "key=value;key2="value nb 2";key3=314"
    • Method Detail

      • getForAsIp

        public String getForAsIp()
        Get the client node IP if set as an IPv4/v6 address.
        Returns:
        the client IP address or null if not set.
      • getByAsIp

        public String getByAsIp()
        Get the proxy node IP if set as an IPv4/v6 address.
        Returns:
        the proxy IP address or null if not set.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object