- java.lang.Object
-
- inet.ipaddr.AddressStringParameters
-
- inet.ipaddr.IPAddressStringParameters
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<IPAddressStringParameters>
public class IPAddressStringParameters extends AddressStringParameters implements java.lang.Comparable<IPAddressStringParameters>
This class allows you to control the validation performed by the classIPAddressString
. TheIPAddressString
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.- Author:
- sfoley
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IPAddressStringParameters.Builder
static class
IPAddressStringParameters.IPAddressStringFormatParameters
-
Nested classes/interfaces inherited from class inet.ipaddr.AddressStringParameters
AddressStringParameters.AddressStringFormatParameters, AddressStringParameters.BuilderBase, AddressStringParameters.RangeParameters
-
-
Field Summary
Fields Modifier and Type Field 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.0boolean
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.-
Fields inherited from class inet.ipaddr.AddressStringParameters
allowAll, allowEmpty, allowSingleSegment, DEFAULT_ALLOW_ALL, DEFAULT_ALLOW_EMPTY, DEFAULT_ALLOW_SINGLE_SEGMENT
-
-
Constructor Summary
Constructors Constructor Description IPAddressStringParameters(boolean allowEmpty, boolean allowAll, boolean allowSingleSegment, boolean emptyIsLoopback, boolean allowPrefix, boolean allowMask, boolean allowPrefixOnly, boolean allowIPv4, boolean allowIPv6, IPv4AddressStringParameters ipv4Options, IPv6AddressStringParameters ipv6Options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IPAddressStringParameters
clone()
int
compareTo(IPAddressStringParameters o)
boolean
equals(java.lang.Object o)
IPv4AddressStringParameters
getIPv4Parameters()
IPv6AddressStringParameters
getIPv6Parameters()
int
hashCode()
IPAddress.IPVersion
inferVersion()
IPAddressStringParameters.Builder
toBuilder()
IPAddressStringParameters.Builder
toBuilder(boolean isMixed)
-
Methods inherited from class inet.ipaddr.AddressStringParameters
compareTo, toBuilder
-
-
-
-
Field Detail
-
DEFAULT_ALLOW_PREFIX_ONLY
public static final boolean DEFAULT_ALLOW_PREFIX_ONLY
- See Also:
- Constant Field Values
-
DEFAULT_EMPTY_IS_LOOPBACK
public static final boolean DEFAULT_EMPTY_IS_LOOPBACK
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_PREFIX
public static final boolean DEFAULT_ALLOW_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_MASK
public static final boolean DEFAULT_ALLOW_MASK
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_IPV4
public static final boolean DEFAULT_ALLOW_IPV4
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_IPV6
public static final boolean DEFAULT_ALLOW_IPV6
- See Also:
- Constant Field Values
-
allowPrefixOnly
public final boolean allowPrefixOnly
Allows addresses like /64 which are only prefix lenths. Such addresses are interpreted as the network mask for the given prefix length.- See Also:
DEFAULT_ALLOW_PREFIX_ONLY
-
emptyIsLoopback
public final boolean emptyIsLoopback
Whether the zero-length address is interpreted as the loopback.
-
allowPrefix
public final boolean allowPrefix
Allows addresses with prefix length like 1.2.0.0/16 Such as an address is interpreted as a subnet. 1.2.0.0/16 is the subnet of addresses with network prefix 1.2- See Also:
DEFAULT_ALLOW_PREFIX
-
allowMask
public final 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.0If 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.
- See Also:
allowPrefix
,DEFAULT_ALLOW_MASK
-
allowIPv6
public final boolean allowIPv6
-
allowIPv4
public final boolean allowIPv4
-
-
Constructor Detail
-
IPAddressStringParameters
public IPAddressStringParameters(boolean allowEmpty, boolean allowAll, boolean allowSingleSegment, boolean emptyIsLoopback, boolean allowPrefix, boolean allowMask, boolean allowPrefixOnly, boolean allowIPv4, boolean allowIPv6, IPv4AddressStringParameters ipv4Options, IPv6AddressStringParameters ipv6Options)
-
-
Method Detail
-
inferVersion
public IPAddress.IPVersion inferVersion()
-
toBuilder
public IPAddressStringParameters.Builder toBuilder()
-
toBuilder
public IPAddressStringParameters.Builder toBuilder(boolean isMixed)
-
getIPv6Parameters
public IPv6AddressStringParameters getIPv6Parameters()
-
getIPv4Parameters
public IPv4AddressStringParameters getIPv4Parameters()
-
clone
public IPAddressStringParameters clone()
- Overrides:
clone
in classAddressStringParameters
-
compareTo
public int compareTo(IPAddressStringParameters o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<IPAddressStringParameters>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classAddressStringParameters
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-