Package zipkin2
Class Endpoint.Builder
- java.lang.Object
-
- zipkin2.Endpoint.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Endpointbuild()Endpoint.Builderip(String ipString)Chaining variant ofparseIp(String)Endpoint.Builderip(InetAddress addr)Chaining variant ofparseIp(InetAddress)booleanparseIp(byte[] ipBytes)LikeparseIp(String)except this accepts a byte array.booleanparseIp(String ipString)Returns true ifEndpoint.ipv4()orEndpoint.ipv6()could be parsed from the input.booleanparseIp(InetAddress addr)Returns true ifEndpoint.ipv4()orEndpoint.ipv6()could be parsed from the input.Endpoint.Builderport(int port)SetsEndpoint.portAsInt()Endpoint.Builderport(Integer port)Use this to set the port to an externally defined value.Endpoint.BuilderserviceName(String serviceName)SetsEndpoint.serviceName
-
-
-
Method Detail
-
serviceName
public Endpoint.Builder serviceName(@Nullable String serviceName)
SetsEndpoint.serviceName
-
ip
public Endpoint.Builder ip(@Nullable InetAddress addr)
Chaining variant ofparseIp(InetAddress)
-
parseIp
public final boolean parseIp(@Nullable InetAddress addr)Returns true ifEndpoint.ipv4()orEndpoint.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)
LikeparseIp(String)except this accepts a byte array.- Parameters:
ipBytes- byte array whose ownership is exclusively transferred to this endpoint.
-
ip
public Endpoint.Builder ip(@Nullable String ipString)
Chaining variant ofparseIp(String)
-
parseIp
public final boolean parseIp(@Nullable String ipString)Returns true ifEndpoint.ipv4()orEndpoint.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 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()
-
port
public Endpoint.Builder port(int port)
SetsEndpoint.portAsInt()
-
build
public Endpoint build()
-
-