@InterfaceAudience.Public @InterfaceStability.Stable public class Address extends Object implements Comparable<Address>
Comparable
In implementation this class is a facade over Guava's HostAndPort
.
We cannot have Guava classes in our API hence this Type.
限定符和类型 | 方法和说明 |
---|---|
int |
compareTo(Address that) |
boolean |
equals(Object other) |
static Address |
fromParts(String hostname,
int port) |
static Address |
fromSocketAddress(InetSocketAddress addr) |
static Address |
fromString(String hostnameAndPort) |
String |
getHostname()
已过时。
Use
getHostName() instead |
String |
getHostName() |
int |
getPort() |
int |
hashCode() |
InetSocketAddress |
toSocketAddress() |
static InetSocketAddress[] |
toSocketAddress(Address[] addrs) |
String |
toString() |
public static Address fromSocketAddress(InetSocketAddress addr)
public InetSocketAddress toSocketAddress()
public static InetSocketAddress[] toSocketAddress(Address[] addrs)
public String getHostName()
@Deprecated public String getHostname()
getHostName()
insteadpublic int getPort()
public int compareTo(Address that)
compareTo
在接口中 Comparable<Address>
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.