public final class NameServerComparator extends Object implements Comparator<InetSocketAddress>, 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.Constructor and Description |
---|
NameServerComparator(Class<? extends InetAddress> preferredAddressType) |
Modifier and Type | Method and Description |
---|---|
int |
compare(InetSocketAddress addr1,
InetSocketAddress addr2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public NameServerComparator(Class<? extends InetAddress> preferredAddressType)
public int compare(InetSocketAddress addr1, InetSocketAddress addr2)
compare
in interface Comparator<InetSocketAddress>
Copyright © 2008–2024 The Netty Project. All rights reserved.