- java.lang.Object
-
- io.netty5.resolver.dns.NameServerComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<InetSocketAddress>
public final class NameServerComparator extends Object implements Comparator<InetSocketAddress>, Serializable
SpecialComparator
implementation to sort the nameservers to use when follow redirects. This implementation follows all the semantics listed in the Comparator apidocs with the limitation thatInetSocketAddress.equals(Object)
will not result in the same return value ascompare(InetSocketAddress, InetSocketAddress)
. This is completely fine as this should only be used to sortList
s.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NameServerComparator(Class<? extends InetAddress> preferredAddressType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(InetSocketAddress addr1, InetSocketAddress addr2)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
NameServerComparator
public NameServerComparator(Class<? extends InetAddress> preferredAddressType)
-
-
Method Detail
-
compare
public int compare(InetSocketAddress addr1, InetSocketAddress addr2)
- Specified by:
compare
in interfaceComparator<InetSocketAddress>
-
-