public final class SingletonDnsServerAddresses extends Object implements DnsServerAddressStream
DnsServerAddressStream which always returns the same InetSocketAddress.| Constructor and Description |
|---|
SingletonDnsServerAddresses(InetSocketAddress address)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
DnsServerAddressStream |
duplicate()
Duplicate this object.
|
InetSocketAddress |
next()
Retrieves the next DNS server address from the stream.
|
int |
size()
Get the number of times
DnsServerAddressStream.next() will return a distinct element before repeating or terminating. |
String |
toString() |
public SingletonDnsServerAddresses(InetSocketAddress address)
address - the address to return in next().public InetSocketAddress next()
DnsServerAddressStreamnext in interface DnsServerAddressStreampublic int size()
DnsServerAddressStreamDnsServerAddressStream.next() will return a distinct element before repeating or terminating.size in interface DnsServerAddressStreamDnsServerAddressStream.next() will return a distinct element before repeating or terminating.public DnsServerAddressStream duplicate()
DnsServerAddressStreamDnsServerAddressStream.next().
Note that Object.clone() isn't used because it may make sense for some implementations to have the
following relationship x.duplicate() == x.
duplicate in interface DnsServerAddressStreampublic String toString()
toString in class Object