public final class NameServerComparator
extends java.lang.Object
implements java.util.Comparator<java.net.InetSocketAddress>, java.io.Serializable
Comparator
implementation to sort the nameservers to use when follow redirects.
This implementation follows all the semantics listed in the
Comparator apidocs
with the limitation that InetSocketAddress.equals(Object)
will not result in the same return value as
compare(InetSocketAddress, InetSocketAddress)
. This is completely fine as this should only be used
to sort List
s.构造器和说明 |
---|
NameServerComparator(java.lang.Class<? extends java.net.InetAddress> preferredAddressType) |
限定符和类型 | 方法和说明 |
---|---|
int |
compare(java.net.InetSocketAddress addr1,
java.net.InetSocketAddress addr2) |