Top Fields Constructors Methods
io.netty5.resolver.dns

pack-priv final Class ShuffledDnsServerAddressStream

extends Object
implements DnsServerAddressStream
Class Inheritance
All Implemented Interfaces
io.netty5.resolver.dns.DnsServerAddressStream
Imports
java.net.InetSocketAddress, java.util.Collections, .List, java.util.concurrent.ThreadLocalRandom

Field Summary

Modifier and TypeField and Description
private final List<InetSocketAddress>
private int
i

Constructor Summary

AccessConstructor and Description
pack-priv
ShuffledDnsServerAddressStream(List<InetSocketAddress>
The addresses are not cloned. It is assumed the caller has cloned this array or otherwise will not modify the contents.
addresses
)

Create a new instance.

private

Method Summary

Modifier and TypeMethod and Description
public ShuffledDnsServerAddressStream
public InetSocketAddress
next()

Implements io.netty5.resolver.dns.DnsServerAddressStream.next.

Retrieves the next DNS server address from the stream.
private void
public int
size()

Implements io.netty5.resolver.dns.DnsServerAddressStream.size.

Get the number of times next() will return a distinct element before repeating or terminating.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

addressesback to summary
private final List<InetSocketAddress> addresses
iback to summary
private int i

Constructor Detail

ShuffledDnsServerAddressStreamback to summary
pack-priv ShuffledDnsServerAddressStream(List<InetSocketAddress> addresses)

Create a new instance.

Parameters
addresses:List<InetSocketAddress>

The addresses are not cloned. It is assumed the caller has cloned this array or otherwise will not modify the contents.

ShuffledDnsServerAddressStreamback to summary
private ShuffledDnsServerAddressStream(List<InetSocketAddress> addresses, int startIdx)

Method Detail

duplicateback to summary
public ShuffledDnsServerAddressStream duplicate()

Implements io.netty5.resolver.dns.DnsServerAddressStream.duplicate.

Doc from io.netty5.resolver.dns.DnsServerAddressStream.duplicate.

Duplicate this object. The result of this should be able to be independently iterated over via next().

Note that clone() isn't used because it may make sense for some implementations to have the following relationship x.duplicate() == x.

Returns:ShuffledDnsServerAddressStream

A duplicate of this object.

Annotations
@Override
nextback to summary
public InetSocketAddress next()

Implements io.netty5.resolver.dns.DnsServerAddressStream.next.

Doc from io.netty5.resolver.dns.DnsServerAddressStream.next.

Retrieves the next DNS server address from the stream.

Annotations
@Override
shuffleback to summary
private void shuffle()
sizeback to summary
public int size()

Implements io.netty5.resolver.dns.DnsServerAddressStream.size.

Doc from io.netty5.resolver.dns.DnsServerAddressStream.size.

Get the number of times next() will return a distinct element before repeating or terminating.

Returns:int

the number of times next() will return a distinct element before repeating or terminating.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override