Class ParsedIPAddress
java.lang.Object
inet.ipaddr.format.validate.ParsedIPAddress
- All Implemented Interfaces:
IPAddressProvider, Serializable
The result from parsing a valid address string. This can be converted into an
IPv4Address or IPv6Address instance.- Author:
- sfoley
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classThe analog to SpecificValueMasker for oringstatic classWhen the part of a mask covering a range of values is a mix of ones and zeros, then there may be an intermediate value in the range that when masked, produces the new upper and lower values.static classNested classes/interfaces inherited from interface IPAddressProvider
IPAddressProvider.AdjustedAddressCreator, IPAddressProvider.AllCreator, IPAddressProvider.CachedAddressProvider, IPAddressProvider.IPType, IPAddressProvider.LoopbackCreator, IPAddressProvider.MaskCreator, IPAddressProvider.NullProvider, IPAddressProvider.VersionedAddressCreator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from interface IPAddressProvider
EMPTY_PROVIDER, INVALID_PROVIDER, NO_TYPE_PROVIDER -
Method Summary
Modifier and TypeMethodDescriptionstatic ParsedIPAddress.BitwiseOrerbitwiseOrRange(long value, long upperValue, long maskValue) static ParsedIPAddress.BitwiseOrerbitwiseOrRange(long value, long upperValue, long maskValue, long maxValue) contains(IPAddressProvider other) An optimized contains that does not need to create address objects to return an answer.An optimized contains that does not need to fully parse the other address to return an answer.If the address was created by parsing, this provides the parameters used when creating the address.getProviderAddress(IPAddress.IPVersion version) intgetType()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanmaskExtendedRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue) static ParsedIPAddress.MaskermaskRange(long value, long upperValue, long maskValue) static ParsedIPAddress.MaskermaskRange(long value, long upperValue, long maskValue, long maxValue) maskRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue) Deprecated.use maskExtendedRangeparsedEquals(IPAddressProvider other) An optimized equality comparison that does not need to create addresses to return an answer.prefixContains(IPAddressProvider other) An optimized prefix comparison that does not need to create addresses to return an answer.prefixContains(String other) An optimized prefix comparison that does not need to create addresses to return an answer.prefixEquals(IPAddressProvider other) An optimized prefix comparison that does not need to create addresses to return an answer.prefixEquals(String other) An optimized prefix comparison that does not need to fully parse the other address to return an answer.toString()Methods inherited from interface IPAddressProvider
getProviderIPVersion, hasPrefixSeparator, isInvalid, isProvidingAllAddresses, isProvidingBase85IPv6, isProvidingEmpty, isProvidingIPv4, isProvidingIPv6, isProvidingMixedIPv6, isProvidingPrefixOnly, isUninitialized, providerCompare, providerEquals, providerHashCode
-
Field Details
-
KEY_WILDCARD
public static final int KEY_WILDCARD- See Also:
-
KEY_SINGLE_WILDCARD
public static final int KEY_SINGLE_WILDCARD- See Also:
-
KEY_STANDARD_STR
public static final int KEY_STANDARD_STR- See Also:
-
KEY_STANDARD_RANGE_STR
public static final int KEY_STANDARD_RANGE_STR- See Also:
-
KEY_RANGE_WILDCARD
public static final int KEY_RANGE_WILDCARD- See Also:
-
KEY_INFERRED_LOWER_BOUNDARY
public static final int KEY_INFERRED_LOWER_BOUNDARY- See Also:
-
KEY_INFERRED_UPPER_BOUNDARY
public static final int KEY_INFERRED_UPPER_BOUNDARY- See Also:
-
KEY_MERGED_MIXED
public static final int KEY_MERGED_MIXED- See Also:
-
KEY_LOWER_RADIX_INDEX
public static final int KEY_LOWER_RADIX_INDEX- See Also:
-
KEY_BIT_SIZE_INDEX
public static final int KEY_BIT_SIZE_INDEX- See Also:
-
FLAGS_INDEX
public static final int FLAGS_INDEX- See Also:
-
KEY_UPPER_RADIX_INDEX
public static final int KEY_UPPER_RADIX_INDEX- See Also:
-
KEY_LOWER
public static final int KEY_LOWER- See Also:
-
KEY_EXTENDED_LOWER
public static final int KEY_EXTENDED_LOWER- See Also:
-
KEY_UPPER
public static final int KEY_UPPER- See Also:
-
KEY_EXTENDED_UPPER
public static final int KEY_EXTENDED_UPPER- See Also:
-
KEY_LOWER_STR_DIGITS_INDEX
public static final int KEY_LOWER_STR_DIGITS_INDEX- See Also:
-
KEY_LOWER_STR_START_INDEX
public static final int KEY_LOWER_STR_START_INDEX- See Also:
-
KEY_LOWER_STR_END_INDEX
public static final int KEY_LOWER_STR_END_INDEX- See Also:
-
KEY_UPPER_STR_DIGITS_INDEX
public static final int KEY_UPPER_STR_DIGITS_INDEX- See Also:
-
KEY_UPPER_STR_START_INDEX
public static final int KEY_UPPER_STR_START_INDEX- See Also:
-
KEY_UPPER_STR_END_INDEX
public static final int KEY_UPPER_STR_END_INDEX- See Also:
-
-
Method Details
-
isProvidingIPAddress
public boolean isProvidingIPAddress()- Specified by:
isProvidingIPAddressin interfaceIPAddressProvider
-
getType
- Specified by:
getTypein interfaceIPAddressProvider
-
getParameters
Description copied from interface:IPAddressProviderIf the address was created by parsing, this provides the parameters used when creating the address.- Specified by:
getParametersin interfaceIPAddressProvider- Returns:
- the parameters used to create the address, or null if no such parameters were used.
-
getProviderSeqRange
- Specified by:
getProviderSeqRangein interfaceIPAddressProvider
-
getProviderMask
- Specified by:
getProviderMaskin interfaceIPAddressProvider
-
getProviderHostAddress
- Specified by:
getProviderHostAddressin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
getProviderAddress
- Specified by:
getProviderAddressin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
getProviderAddress
public IPAddress getProviderAddress(IPAddress.IPVersion version) throws IncompatibleAddressException - Specified by:
getProviderAddressin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
getDivisionGrouping
- Specified by:
getDivisionGroupingin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
maskRange
@Deprecated public static ParsedIPAddress.ExtendedMasker maskRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue) Deprecated.use maskExtendedRange- Parameters:
value-extendedValue-upperValue-extendedUpperValue-maskValue-extendedMaskValue-maxValue-extendedMaxValue-- Returns:
-
maskExtendedRange
public static ParsedIPAddress.ExtendedMasker maskExtendedRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue) -
maskRange
- Parameters:
value-upperValue-maskValue-- Returns:
- an instance what will produce the result of masking the values -1 if not compatible and x where x >= 0 if compatible. If x is 0, then the resulting masked range is (value invalid input: '&' maskValue) to (upperValue invalid input: '&' maskValue). If x > 0, then the resulting masked range is (value invalid input: '&' maskValue invalid input: '&' lowerMask) to ((upperValue invalid input: '&' maskValue) | upperMask) where upperMask is ~0 >>> x and lowerMask = ~upperMask.
-
maskRange
public static ParsedIPAddress.Masker maskRange(long value, long upperValue, long maskValue, long maxValue) -
bitwiseOrRange
public static ParsedIPAddress.BitwiseOrer bitwiseOrRange(long value, long upperValue, long maskValue) -
bitwiseOrRange
public static ParsedIPAddress.BitwiseOrer bitwiseOrRange(long value, long upperValue, long maskValue, long maxValue) -
isSequential
public boolean isSequential()- Specified by:
isSequentialin interfaceIPAddressProvider
-
contains
Description copied from interface:IPAddressProviderAn optimized contains that does not need to fully parse the other address to return an answer. Unconventional addresses may require full parsing, in such cases null is returned. Addresses constructed from canonical or normalized representations with no wildcards will not return null.- Specified by:
containsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
prefixContains
Description copied from interface:IPAddressProviderAn optimized prefix comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
prefixContainsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
prefixEquals
Description copied from interface:IPAddressProviderAn optimized prefix comparison that does not need to fully parse the other address to return an answer. Unconventional addresses may require full parsing, in such cases null is returned. Addresses constructed from canonical or normalized representations with no wildcards will not return null.- Specified by:
prefixEqualsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
contains
Description copied from interface:IPAddressProviderAn optimized contains that does not need to create address objects to return an answer. Unconventional addresses may require that the address objects are created, in such cases null is returned. Addresses constructed from canonical or normalized representations with no wildcards will not return null.- Specified by:
containsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
parsedEquals
Description copied from interface:IPAddressProviderAn optimized equality comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
parsedEqualsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
prefixContains
Description copied from interface:IPAddressProviderAn optimized prefix comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
prefixContainsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
prefixEquals
Description copied from interface:IPAddressProviderAn optimized prefix comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
prefixEqualsin interfaceIPAddressProvider- Parameters:
other-- Returns:
-
getProviderNetworkPrefixLength
- Specified by:
getProviderNetworkPrefixLengthin interfaceIPAddressProvider
-
getProviderIPVersion
-
isProvidingIPv6
public boolean isProvidingIPv6() -
isProvidingIPv4
public boolean isProvidingIPv4() -
hasPrefixSeparator
public boolean hasPrefixSeparator() -
isProvidingBase85IPv6
public boolean isProvidingBase85IPv6() -
isProvidingMixedIPv6
public boolean isProvidingMixedIPv6() -
toString
-
getSegmentCount
public int getSegmentCount() -
isProvidingEmpty
public boolean isProvidingEmpty()
-