java.lang.Object
java.net.spi.InetAddressResolver.LookupPolicy
- Enclosing interface:
- InetAddressResolver
A 
LookupPolicy object describes characteristics that can be applied to a lookup operation.
 In particular, it is used to specify the ordering and which filtering should be performed when
 looking up host addresses.
 The default platform-wide lookup policy is constructed by consulting System Properties which affect how IPv4 and IPv6 addresses are returned.
- Since:
- 18
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intCharacteristic value signifying if IPv4 addresses need to be queried during lookup.static final intCharacteristic value signifying if IPv4 addresses should be returned first byInetAddressResolver.static final intCharacteristic value signifying if IPv6 addresses need to be queried during lookup.static final intCharacteristic value signifying if IPv6 addresses should be returned first byInetAddressResolver.
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the set of characteristics of this lookup policy.of(int characteristics) This factory method creates aLookupPolicyinstance with the givencharacteristicsvalue.
- 
Field Details- 
IPV4Characteristic value signifying if IPv4 addresses need to be queried during lookup.- See Also:
 
- 
IPV6Characteristic value signifying if IPv6 addresses need to be queried during lookup.- See Also:
 
- 
IPV4_FIRSTCharacteristic value signifying if IPv4 addresses should be returned first byInetAddressResolver.- See Also:
 
- 
IPV6_FIRSTCharacteristic value signifying if IPv6 addresses should be returned first byInetAddressResolver.- See Also:
 
 
- 
- 
Method Details- 
ofThis factory method creates aLookupPolicyinstance with the givencharacteristicsvalue.The characteristicsvalue is an integer bit mask which defines parameters of a forward lookup operation. These parameters define at least:- the family type of the returned addresses
- the order in which a resolver implementation should return its results
 To request addresses of specific family types the following bit masks can be combined: 
 It is an error if neitherIPV4orIPV6are set.To request a specific ordering of the results: - IPV4_FIRST: return IPv4 addresses before any IPv6 address
- IPV6_FIRST: return IPv6 addresses before any IPv4 address
 
 If neitherIPV4_FIRSTorIPV6_FIRSTare set it implies "system" order of addresses. It is an error to request bothIPV4_FIRSTandIPV6_FIRST.- Parameters:
- characteristics- a value which represents the set of lookup characteristics
- Returns:
- an instance of InetAddressResolver.LookupPolicy
- Throws:
- IllegalArgumentException- if an illegal characteristics bit mask is provided
- See Also:
 
- 
characteristicspublic int characteristics()Returns the set of characteristics of this lookup policy.- Returns:
- a characteristics value
- See Also:
 
 
-