InetAddressResolver
public static final class InetAddressResolver.LookupPolicy extends Object
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.
Modifier and Type | Field | Description |
---|---|---|
static final int |
IPV4 |
Characteristic value signifying if IPv4 addresses need to be queried during lookup. |
static final int |
IPV4_FIRST |
Characteristic value signifying if IPv4 addresses should be returned first by InetAddressResolver . |
static final int |
IPV6 |
Characteristic value signifying if IPv6 addresses need to be queried during lookup. |
static final int |
IPV6_FIRST |
Characteristic value signifying if IPv6 addresses should be returned first by InetAddressResolver . |
Modifier and Type | Method | Description |
---|---|---|
int |
characteristics() |
Returns the set of characteristics of this lookup policy. |
static InetAddressResolver.LookupPolicy |
of |
This factory method creates a LookupPolicy instance with the given characteristics value. |
@Native public static final int IPV4
@Native public static final int IPV6
@Native public static final int IPV4_FIRST
InetAddressResolver
.@Native public static final int IPV6_FIRST
InetAddressResolver
.public static InetAddressResolver.LookupPolicy of(int characteristics)
LookupPolicy
instance with the given characteristics
value. The characteristics
value is an integer bit mask which defines parameters of a forward lookup operation. These parameters define at least:
To request addresses of specific family types the following bit masks can be combined:
IPV4
or IPV6
are set. To request a specific ordering of the results:
IPV4_FIRST
: return IPv4 addresses before any IPv6 addressIPV6_FIRST
: return IPv6 addresses before any IPv4 addressIPV4_FIRST
or IPV6_FIRST
are set it implies "system" order of addresses. It is an error to request both IPV4_FIRST
and IPV6_FIRST
.characteristics
- a value which represents the set of lookup characteristicsInetAddressResolver.LookupPolicy
IllegalArgumentException
- if an illegal characteristics bit mask is providedpublic int characteristics()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/spi/InetAddressResolver.LookupPolicy.html