java.lang.Object
inet.ipaddr.AddressStringParameters.AddressStringFormatParameters
inet.ipaddr.IPAddressStringParameters.IPAddressStringFormatParameters
inet.ipaddr.ipv4.IPv4AddressStringParameters
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IPv4AddressStringParameters>
public class IPv4AddressStringParameters
extends IPAddressStringParameters.IPAddressStringFormatParameters
implements Comparable<IPv4AddressStringParameters>
The IPv4-specific parameters within a
IPAddressStringParameters
instance.- Author:
- sfoley
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
static final boolean
static final boolean
final boolean
Allows single-segment inet_aton strings to have extraneous digits.final boolean
Allows ipv4 inet_aton hexadecimal format 0xa.0xb.0xc.0xdfinal boolean
Allows ipv4 joined segments like 1.2.3, 1.2, or just 1 For the case of just 1 segment, the behaviour is controlled byAddressStringParameters.allowSingleSegment
final boolean
Allows ipv4 inet_aton hexadecimal or octal to have leading zeros, such as in the first two segments of 0x0a.00b.c.d The first 0 is not considered a leading zero, it either denotes octal or hex depending on whether it is followed by an 'x'.final boolean
Allows ipv4 inet_aton octal format, 04.05.06.07 being an example.final boolean
If you allow ipv4 joined segments, whether you allow a mask that looks like a prefix length: 1.2.3.5/255Fields inherited from class inet.ipaddr.IPAddressStringParameters.IPAddressStringFormatParameters
allowBinary, allowPrefixesBeyondAddressSize, allowPrefixLengthLeadingZeros, DEFAULT_ALLOW_BINARY, DEFAULT_ALLOW_PREFIX_BEYOND_ADDRESS_SIZE, DEFAULT_ALLOW_PREFIX_LENGTH_LEADING_ZEROS
Fields inherited from class inet.ipaddr.AddressStringParameters.AddressStringFormatParameters
allowLeadingZeros, allowUnlimitedLeadingZeros, allowWildcardedSeparator, DEFAULT_ALLOW_LEADING_ZEROS, DEFAULT_ALLOW_UNLIMITED_LEADING_ZEROS, DEFAULT_ALLOW_WILDCARDED_SEPARATOR, DEFAULT_RANGE_OPTIONS, rangeOptions
-
Constructor Summary
ConstructorsConstructorDescriptionIPv4AddressStringParameters
(boolean allowLeadingZeros, boolean allowCIDRPrefixLeadingZeros, boolean allowUnlimitedLeadingZeros, AddressStringParameters.RangeParameters rangeOptions, boolean allowWildcardedSeparator, boolean allowPrefixesBeyondAddressSize, boolean allowBinary, boolean inet_aton_hex, boolean inet_aton_octal, boolean inet_aton_leading_zeros, boolean inet_aton_joinedSegments, boolean inet_aton_single_segment_mask, boolean inet_aton_extraneous_digits, IPv4AddressNetwork network) Constructs the parameters for IPv4-specific string parsing.IPv4AddressStringParameters
(boolean allowLeadingZeros, boolean allowCIDRPrefixLeadingZeros, boolean allowUnlimitedLeadingZeros, AddressStringParameters.RangeParameters rangeOptions, boolean allowWildcardedSeparator, boolean allowPrefixesBeyondAddressSize, boolean inet_aton_hex, boolean inet_aton_octal, boolean inet_aton_leading_zeros, boolean inet_aton_joinedSegments, boolean inet_aton_single_segment_mask, IPv4AddressNetwork network) Deprecated. -
Method Summary
-
Field Details
-
DEFAULT_ALLOW_IPV4_INET_ATON
public static final boolean DEFAULT_ALLOW_IPV4_INET_ATON- See Also:
-
DEFAULT_ALLOW_IPV4_INET_ATON_SINGLE_SEGMENT_MASK
public static final boolean DEFAULT_ALLOW_IPV4_INET_ATON_SINGLE_SEGMENT_MASK- See Also:
-
DEFAULT_ALLOW_IPV4_inet_aton_extraneous_digits
public static final boolean DEFAULT_ALLOW_IPV4_inet_aton_extraneous_digits- See Also:
-
inet_aton_hex
public final boolean inet_aton_hexAllows ipv4 inet_aton hexadecimal format 0xa.0xb.0xc.0xd -
inet_aton_octal
public final boolean inet_aton_octalAllows ipv4 inet_aton octal format, 04.05.06.07 being an example. Can be overridden byAddressStringParameters.AddressStringFormatParameters.allowLeadingZeros
-
inet_aton_leading_zeros
public final boolean inet_aton_leading_zerosAllows ipv4 inet_aton hexadecimal or octal to have leading zeros, such as in the first two segments of 0x0a.00b.c.d The first 0 is not considered a leading zero, it either denotes octal or hex depending on whether it is followed by an 'x'. Zeros that appear afterwards are inet_aton leading zeros. -
inet_aton_joinedSegments
public final boolean inet_aton_joinedSegmentsAllows ipv4 joined segments like 1.2.3, 1.2, or just 1 For the case of just 1 segment, the behaviour is controlled byAddressStringParameters.allowSingleSegment
-
inet_aton_single_segment_mask
public final boolean inet_aton_single_segment_maskIf you allow ipv4 joined segments, whether you allow a mask that looks like a prefix length: 1.2.3.5/255 -
inet_aton_extraneous_digits
public final boolean inet_aton_extraneous_digitsAllows single-segment inet_aton strings to have extraneous digits. This allows up to 31 digits when parsing for both IPv4 and IPv6. This allows an unlimited number of digits when parsing for just IPv4 (ieIPAddressStringParameters.allowIPv6
is false).Digits that go beyond 32 bits are essentially ignored. The number of digits before exceeding 32 bits depends on the radix. The value of the most significant digit before exceeding 32 bits depends on the radix.
The resulting address is the modulus of the address with the 32-bit unsigned int maximum value, or equivalently the truncation of the address to 32 bits.
-
-
Constructor Details
-
IPv4AddressStringParameters
@Deprecated public IPv4AddressStringParameters(boolean allowLeadingZeros, boolean allowCIDRPrefixLeadingZeros, boolean allowUnlimitedLeadingZeros, AddressStringParameters.RangeParameters rangeOptions, boolean allowWildcardedSeparator, boolean allowPrefixesBeyondAddressSize, boolean inet_aton_hex, boolean inet_aton_octal, boolean inet_aton_leading_zeros, boolean inet_aton_joinedSegments, boolean inet_aton_single_segment_mask, IPv4AddressNetwork network) Deprecated.Retained for backwards compatibility
Library users are strongly encourage to use the builder classes instead of this constructor. -
IPv4AddressStringParameters
public IPv4AddressStringParameters(boolean allowLeadingZeros, boolean allowCIDRPrefixLeadingZeros, boolean allowUnlimitedLeadingZeros, AddressStringParameters.RangeParameters rangeOptions, boolean allowWildcardedSeparator, boolean allowPrefixesBeyondAddressSize, boolean allowBinary, boolean inet_aton_hex, boolean inet_aton_octal, boolean inet_aton_leading_zeros, boolean inet_aton_joinedSegments, boolean inet_aton_single_segment_mask, boolean inet_aton_extraneous_digits, IPv4AddressNetwork network) Constructs the parameters for IPv4-specific string parsing.
Users are strongly encouraged to use the nested Builder class instead of this constructor.- Parameters:
allowLeadingZeros
-allowCIDRPrefixLeadingZeros
-allowUnlimitedLeadingZeros
-rangeOptions
-allowWildcardedSeparator
-allowPrefixesBeyondAddressSize
-allowBinary
-inet_aton_hex
-inet_aton_octal
-inet_aton_leading_zeros
-inet_aton_joinedSegments
-inet_aton_single_segment_mask
-network
-
-
-
Method Details
-
toBuilder
-
getNetwork
- Specified by:
getNetwork
in classIPAddressStringParameters.IPAddressStringFormatParameters
-
clone
-
compareTo
- Specified by:
compareTo
in interfaceComparable<IPv4AddressStringParameters>
-
equals
- Overrides:
equals
in classIPAddressStringParameters.IPAddressStringFormatParameters
-
hashCode
public int hashCode()- Overrides:
hashCode
in classIPAddressStringParameters.IPAddressStringFormatParameters
-