Class ShuffledDnsServerAddressStream
java.lang.Object
io.netty.resolver.dns.ShuffledDnsServerAddressStream
- All Implemented Interfaces:
DnsServerAddressStream
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)ShuffledDnsServerAddressStream(List<InetSocketAddress> addresses) Create a new instance.privateShuffledDnsServerAddressStream(List<InetSocketAddress> addresses, int startIdx) -
Method Summary
Modifier and TypeMethodDescriptionDuplicate this object.next()Retrieves the next DNS server address from the stream.private voidshuffle()intsize()Get the number of timesDnsServerAddressStream.next()will return a distinct element before repeating or terminating.toString()
-
Field Details
-
addresses
-
i
private int i
-
-
Constructor Details
-
ShuffledDnsServerAddressStream
ShuffledDnsServerAddressStream(List<InetSocketAddress> addresses) Create a new instance.- Parameters:
addresses- The addresses are not cloned. It is assumed the caller has cloned this array or otherwise will not modify the contents.
-
ShuffledDnsServerAddressStream
-
-
Method Details
-
shuffle
private void shuffle() -
next
Description copied from interface:DnsServerAddressStreamRetrieves the next DNS server address from the stream.- Specified by:
nextin interfaceDnsServerAddressStream
-
size
public int size()Description copied from interface:DnsServerAddressStreamGet the number of timesDnsServerAddressStream.next()will return a distinct element before repeating or terminating.- Specified by:
sizein interfaceDnsServerAddressStream- Returns:
- the number of times
DnsServerAddressStream.next()will return a distinct element before repeating or terminating.
-
duplicate
Description copied from interface:DnsServerAddressStreamDuplicate this object. The result of this should be able to be independently iterated over viaDnsServerAddressStream.next().Note that
isn't used because it may make sense for some implementations to have the following relationshipinvalid reference
#clone()x.duplicate() == x.- Specified by:
duplicatein interfaceDnsServerAddressStream- Returns:
- A duplicate of this object.
-
toString
-