public class IPAddressStringParameters extends AddressStringParameters implements Comparable<IPAddressStringParameters>
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.IPAddressStringFormatParameters |
AddressStringParameters.AddressStringFormatParameters, AddressStringParameters.BuilderBase, AddressStringParameters.RangeParameters| Modifier and Type | Field and Description |
|---|---|
boolean |
allowIPv4 |
boolean |
allowIPv6 |
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_IPV4 |
static boolean |
DEFAULT_ALLOW_IPV6 |
static boolean |
DEFAULT_ALLOW_MASK |
static boolean |
DEFAULT_ALLOW_PREFIX |
static boolean |
DEFAULT_ALLOW_PREFIX_ONLY |
static boolean |
DEFAULT_EMPTY_IS_LOOPBACK |
boolean |
emptyIsLoopback
Whether the zero-length address is interpreted as the loopback.
|
allowAll, allowEmpty, allowSingleSegment, DEFAULT_ALLOW_ALL, DEFAULT_ALLOW_EMPTY, DEFAULT_ALLOW_SINGLE_SEGMENT| Constructor and Description |
|---|
IPAddressStringParameters(boolean allowEmpty,
boolean allowAll,
boolean allowSingleSegment,
boolean emptyIsLoopback,
boolean allowPrefix,
boolean allowMask,
boolean allowPrefixOnly,
boolean allowIPv4,
boolean allowIPv6,
IPv4AddressStringParameters ipv4Options,
IPv6AddressStringParameters ipv6Options) |
| Modifier and Type | Method and Description |
|---|---|
IPAddressStringParameters |
clone() |
int |
compareTo(IPAddressStringParameters o) |
boolean |
equals(Object o) |
IPv4AddressStringParameters |
getIPv4Parameters() |
IPv6AddressStringParameters |
getIPv6Parameters() |
int |
hashCode() |
IPAddress.IPVersion |
inferVersion() |
IPAddressStringParameters.Builder |
toBuilder() |
IPAddressStringParameters.Builder |
toBuilder(boolean isMixed) |
compareTo, toBuilderpublic static final boolean DEFAULT_ALLOW_PREFIX_ONLY
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_IPV4
public static final boolean DEFAULT_ALLOW_IPV6
public final boolean allowPrefixOnly
DEFAULT_ALLOW_PREFIX_ONLYpublic final boolean emptyIsLoopback
public final boolean allowPrefix
DEFAULT_ALLOW_PREFIXpublic 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_MASKpublic final boolean allowIPv6
public final boolean allowIPv4
public IPAddressStringParameters(boolean allowEmpty,
boolean allowAll,
boolean allowSingleSegment,
boolean emptyIsLoopback,
boolean allowPrefix,
boolean allowMask,
boolean allowPrefixOnly,
boolean allowIPv4,
boolean allowIPv6,
IPv4AddressStringParameters ipv4Options,
IPv6AddressStringParameters ipv6Options)
public IPAddress.IPVersion inferVersion()
public IPAddressStringParameters.Builder toBuilder()
public IPAddressStringParameters.Builder toBuilder(boolean isMixed)
public IPv6AddressStringParameters getIPv6Parameters()
public IPv4AddressStringParameters getIPv4Parameters()
public IPAddressStringParameters clone()
clone in class AddressStringParameterspublic int compareTo(IPAddressStringParameters o)
compareTo in interface Comparable<IPAddressStringParameters>public boolean equals(Object o)
equals in class AddressStringParameters