Enum Class IPMode
- All Implemented Interfaces:
Serializable, Comparable<IPMode>, Constable
The IP address mode of the IP2Location service: IPv4 only, or IPv4 and IPv6. Ported from the NetPhantom administration panel (
co.mindus.ip2location.ui.IPMode), where the two radio buttons of the IP2Location page choose between them; the setting behind it is the boolean ServerSettings.IP2LOCATION_IPV6.IPv4 and IPv6 downloads and loads both database files, which roughly doubles the disk and memory the service takes; IPv4 only answers IPv6 lookups with "not supported" (6to4 and Teredo addresses still resolve through their embedded IPv4 address).
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIPv4 and IPv6 addresses: two database files.IPv4 addresses only: one database file.Method Summary
Modifier and TypeMethodDescriptionstatic IPModefromIncludeIPv6(boolean includeIPv6) Gets the mode of the IPv6 flag.static IPModeGets the mode of a name, leniently.booleanChecks if this mode includes IPv6.static IPModeReturns the enum constant of this class with the specified name.static IPMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
IPV4_ONLY
IPv4 addresses only: one database file.IPV4_AND_IPV6
IPv4 and IPv6 addresses: two database files.
Method Details
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
includesIPv6
public boolean includesIPv6()Checks if this mode includes IPv6.- Returns:
- true for
IPV4_AND_IPV6, false forIPV4_ONLY.
fromIncludeIPv6
Gets the mode of the IPv6 flag.- Parameters:
includeIPv6- The flag, asServerSettings.isIP2LocationIPv6Enabled()answers it.- Returns:
IPV4_AND_IPV6for true,IPV4_ONLYfor false.
fromName