Package zipkin2

Class Endpoint.Builder

  • Enclosing class:
    Endpoint

    public static final class Endpoint.Builder
    extends java.lang.Object
    • Method Detail

      • parseIp

        public final boolean parseIp​(@Nullable
                                     java.net.InetAddress addr)
        Returns true if Endpoint.ipv4() or Endpoint.ipv6() could be parsed from the input.

        Returns boolean not this for conditional parsing. For example:

        
         if (!builder.parseIp(input.getHeader("X-Forwarded-For"))) {
           builder.parseIp(input.getRemoteAddr());
         }
         
        See Also:
        parseIp(String)
      • parseIp

        public final boolean parseIp​(byte[] ipBytes)
        Like parseIp(String) except this accepts a byte array.
        Parameters:
        ipBytes - byte array whose ownership is exclusively transferred to this endpoint.
      • parseIp

        public final boolean parseIp​(@Nullable
                                     java.lang.String ipString)
        Returns true if Endpoint.ipv4() or Endpoint.ipv6() could be parsed from the input.

        Returns boolean not this for conditional parsing. For example:

        
         if (!builder.parseIp(input.getHeader("X-Forwarded-For"))) {
           builder.parseIp(input.getRemoteAddr());
         }
         
        See Also:
        parseIp(InetAddress)
      • port

        public Endpoint.Builder port​(@Nullable
                                     java.lang.Integer port)
        Use this to set the port to an externally defined value.
        Parameters:
        port - port associated with the endpoint. zero coerces to null (unknown)
        See Also:
        Endpoint.port()