java.lang.Object
inet.ipaddr.AddressStringParameters
inet.ipaddr.IPAddressStringParameters
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IPAddressStringParameters>
public class IPAddressStringParameters
extends AddressStringParameters
implements Comparable<IPAddressStringParameters>
This class allows you to control the validation performed by the class
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.- Author:
- sfoley
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class inet.ipaddr.AddressStringParameters
AddressStringParameters.AddressStringFormatParameters, AddressStringParameters.BuilderBase, AddressStringParameters.RangeParameters
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal boolean
final boolean
final boolean
Allows masks to follow valid addresses, such as 1.2.3.4/255.255.0.0 which has the mask 255.255.0.0final boolean
Allows addresses with prefix length like 1.2.0.0/16 Such as an address is interpreted as a subnet.final boolean
Allows addresses like /64 which are only prefix lenths.static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
final boolean
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
ConstructorsConstructorDescriptionIPAddressStringParameters
(boolean allowEmpty, boolean allowAll, boolean allowSingleSegment, boolean emptyIsLoopback, boolean allowPrefix, boolean allowMask, boolean allowPrefixOnly, boolean allowIPv4, boolean allowIPv6, IPv4AddressStringParameters ipv4Options, IPv6AddressStringParameters ipv6Options) -
Method Summary
Methods inherited from class inet.ipaddr.AddressStringParameters
compareTo, toBuilder
-
Field Details
-
DEFAULT_ALLOW_PREFIX_ONLY
public static final boolean DEFAULT_ALLOW_PREFIX_ONLY- See Also:
-
DEFAULT_EMPTY_IS_LOOPBACK
public static final boolean DEFAULT_EMPTY_IS_LOOPBACK- See Also:
-
DEFAULT_ALLOW_PREFIX
public static final boolean DEFAULT_ALLOW_PREFIX- See Also:
-
DEFAULT_ALLOW_MASK
public static final boolean DEFAULT_ALLOW_MASK- See Also:
-
DEFAULT_ALLOW_IPV4
public static final boolean DEFAULT_ALLOW_IPV4- See Also:
-
DEFAULT_ALLOW_IPV6
public static final boolean DEFAULT_ALLOW_IPV6- See Also:
-
allowPrefixOnly
public final boolean allowPrefixOnlyAllows addresses like /64 which are only prefix lenths. Such addresses are interpreted as the network mask for the given prefix length.- See Also:
-
emptyIsLoopback
public final boolean emptyIsLoopbackWhether the zero-length address is interpreted as the loopback.- See Also:
-
allowPrefix
public final boolean allowPrefixAllows 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:
-
allowMask
public final boolean allowMaskAllows 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:
-
allowIPv6
public final boolean allowIPv6 -
allowIPv4
public final boolean allowIPv4
-
-
Constructor Details
-
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 Details
-
inferVersion
-
toBuilder
-
toBuilder
-
getIPv6Parameters
-
getIPv4Parameters
-
clone
- Overrides:
clone
in classAddressStringParameters
-
compareTo
- Specified by:
compareTo
in interfaceComparable<IPAddressStringParameters>
-
equals
- Overrides:
equals
in classAddressStringParameters
-
hashCode
public int hashCode()
-