public enum IPMode extends Enum<IPMode>
This enum represents the choice between IPv4-only support and combined IPv4+IPv6 support in the IP2Location service.
| Mode | Description | Relative DB Size |
|---|---|---|
| IPV4_ONLY | IPv4 addresses only | 1x |
| IPV4_AND_IPV6 | IPv4 and IPv6 addresses | ~2-3x |
Choose IPv4-only when IPv6 support is not needed to reduce disk space and memory usage.
IP2LocationConfig| Enum Constant and Description |
|---|
IPV4_AND_IPV6
Both IPv4 and IPv6 addresses.
|
IPV4_ONLY
IPv4 addresses only.
|
| Modifier and Type | Method and Description |
|---|---|
static IPMode |
fromIncludeIPv6(boolean includeIPv6)
Converts a boolean flag to IPMode.
|
String |
getDescription()
Gets the full description.
|
String |
getLabel()
Gets the short display label.
|
boolean |
includesIPv6()
Converts to a boolean flag.
|
String |
toString() |
static IPMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IPMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IPMode IPV4_ONLY
Only IPv4 database files are downloaded and used. IPv6 lookups will return NOT_SUPPORTED status.
public static final IPMode IPV4_AND_IPV6
Both IPv4 and IPv6 database files are downloaded and used. This roughly doubles the disk and memory requirements.
public static IPMode[] values()
for (IPMode c : IPMode.values()) System.out.println(c);
public static IPMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getLabel()
public String getDescription()
public static IPMode fromIncludeIPv6(boolean includeIPv6)
includeIPv6 - true for IPv4+IPv6, false for IPv4 onlypublic boolean includesIPv6()
true if this mode includes IPv6Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© 2026 Mindus SARL. All rights reserved.