public class IPAddressStringParameters extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<IPAddressStringParameters>, java.io.Serializable
IPAddressString
.
The IPAddressString
class uses a default permissive IPAddressStringParameters instance when you do not specify one.
If you wish to use parameters different from the default, then use this class. All instances are immutable and must be constructed with the nested Builder class.Modifier and Type | Class and Description |
---|---|
static class |
IPAddressStringParameters.Builder |
static class |
IPAddressStringParameters.IPVersionAddressStringParameters |
static class |
IPAddressStringParameters.RangeParameters
Controls special characters in addresses like '*', '-', '_'
|
Modifier and Type | Field and Description |
---|---|
boolean |
allowAll
Allows the all-encompassing address *, which represents the network of all IPv4 and IPv6 addresses
|
boolean |
allowEmpty
Allows zero-length IPAddressStrings like ""
|
boolean |
allowMask
Allows masks to follow valid addresses, such as 1.2.3.4/255.255.0.0 which has the mask 255.255.0.0
|
boolean |
allowPrefix
Allows addresses with prefix length like 1.2.0.0/16
Such as an address is interpreted as a subnet.
|
boolean |
allowPrefixOnly
Allows addresses like /64 which are only prefix lenths.
|
static boolean |
DEFAULT_ALLOW_ALL |
static boolean |
DEFAULT_ALLOW_EMPTY |
static boolean |
DEFAULT_ALLOW_LEADING_ZEROS |
static boolean |
DEFAULT_ALLOW_MASK |
static boolean |
DEFAULT_ALLOW_PREFIX |
static boolean |
DEFAULT_ALLOW_PREFIX_BEYOND_ADDRESS_SIZE |
static boolean |
DEFAULT_ALLOW_PREFIX_LENGTH_LEADING_ZEROS |
static boolean |
DEFAULT_ALLOW_PREFIX_ONLY |
static boolean |
DEFAULT_ALLOW_UNLIMITED_LEADING_ZEROS |
static boolean |
DEFAULT_ALLOW_WILDCARDED_SEPARATOR |
static boolean |
DEFAULT_EMPTY_IS_LOOPBACK |
static IPAddressStringParameters.RangeParameters |
DEFAULT_RANGE_OPTIONS |
boolean |
emptyIsLoopback
Whether the zero-length address is interpreted as the loopback.
|
Constructor and Description |
---|
IPAddressStringParameters(boolean allowEmpty,
boolean allowAll,
boolean emptyIsLoopback,
boolean allowPrefix,
boolean allowMask,
boolean allowPrefixOnly,
IPv4AddressStringParameters ipv4Options,
IPv6AddressStringParameters ipv6Options) |
Modifier and Type | Method and Description |
---|---|
IPAddressStringParameters |
clone() |
int |
compareTo(IPAddressStringParameters o) |
boolean |
equals(java.lang.Object o) |
IPv4AddressStringParameters |
getIPv4Parameters() |
IPv6AddressStringParameters |
getIPv6Parameters() |
int |
hashCode() |
IPAddressStringParameters.Builder |
toBuilder() |
IPAddressStringParameters.Builder |
toBuilder(boolean isMixed) |
public static final boolean DEFAULT_ALLOW_LEADING_ZEROS
public static final boolean DEFAULT_ALLOW_PREFIX_LENGTH_LEADING_ZEROS
public static final boolean DEFAULT_ALLOW_UNLIMITED_LEADING_ZEROS
public static final boolean DEFAULT_ALLOW_EMPTY
public static final boolean DEFAULT_EMPTY_IS_LOOPBACK
public static final boolean DEFAULT_ALLOW_PREFIX
public static final boolean DEFAULT_ALLOW_MASK
public static final boolean DEFAULT_ALLOW_PREFIX_ONLY
public static final boolean DEFAULT_ALLOW_ALL
public static final boolean DEFAULT_ALLOW_WILDCARDED_SEPARATOR
public static final boolean DEFAULT_ALLOW_PREFIX_BEYOND_ADDRESS_SIZE
public static final IPAddressStringParameters.RangeParameters DEFAULT_RANGE_OPTIONS
public final boolean allowEmpty
emptyIsLoopback
,
DEFAULT_ALLOW_EMPTY
public final boolean allowPrefixOnly
DEFAULT_ALLOW_PREFIX_ONLY
public final boolean allowAll
DEFAULT_ALLOW_ALL
public final boolean emptyIsLoopback
allowEmpty
,
DEFAULT_EMPTY_IS_LOOPBACK
public final boolean allowPrefix
DEFAULT_ALLOW_PREFIX
public final boolean allowMask
If the mask is the mask for a network prefix length, this is interpreted as the subnet for that network prefix length. Otherwise the address is simply masked by the mask. For instance, 1.2.3.4/255.0.255.0 is 1.0.3.0, while 1.2.3.4/255.255.0.0 is 1.2.0.0/16.
allowPrefix
,
DEFAULT_ALLOW_MASK
public IPAddressStringParameters(boolean allowEmpty, boolean allowAll, boolean emptyIsLoopback, boolean allowPrefix, boolean allowMask, boolean allowPrefixOnly, IPv4AddressStringParameters ipv4Options, IPv6AddressStringParameters ipv6Options)
public IPAddressStringParameters.Builder toBuilder()
public IPAddressStringParameters.Builder toBuilder(boolean isMixed)
public IPv6AddressStringParameters getIPv6Parameters()
public IPv4AddressStringParameters getIPv4Parameters()
public IPAddressStringParameters clone()
clone
in class java.lang.Object
public int compareTo(IPAddressStringParameters o)
compareTo
in interface java.lang.Comparable<IPAddressStringParameters>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object