-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
IPAddressProvider.AdjustedAddressCreator,IPAddressProvider.AllCreator,IPAddressProvider.CachedAddressProvider,IPAddressProvider.LoopbackCreator,IPAddressProvider.MaskCreator,IPAddressProvider.NullProvider,IPAddressProvider.VersionedAddressCreator,ParsedIPAddress
public interface IPAddressProvider extends java.io.SerializableProvides an address corresponding to a parsed string.- Author:
- sfoley
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIPAddressProvider.AdjustedAddressCreatorstatic classIPAddressProvider.AllCreatorstatic classIPAddressProvider.CachedAddressProviderstatic classIPAddressProvider.IPTypestatic classIPAddressProvider.LoopbackCreatorstatic classIPAddressProvider.MaskCreatorstatic classIPAddressProvider.NullProviderstatic classIPAddressProvider.VersionedAddressCreator
-
Field Summary
Fields Modifier and Type Field Description static IPAddressProvider.NullProviderEMPTY_PROVIDERstatic IPAddressProvider.NullProviderINVALID_PROVIDERstatic IPAddressProvider.NullProviderNO_TYPE_PROVIDER
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Booleancontains(IPAddressProvider other)An optimized contains that does not need to create address objects to return an answer.default java.lang.Booleancontains(java.lang.String other)An optimized contains that does not need to fully parse the other address to return an answer.default IPAddressDivisionSeriesgetDivisionGrouping()default IPAddressStringParametersgetParameters()If the address was created by parsing, this provides the parameters used when creating the address.IPAddressgetProviderAddress()IPAddressgetProviderAddress(IPAddress.IPVersion version)static IPAddressProvidergetProviderFor(IPAddress address, IPAddress hostAddress)Wraps an IPAddress for IPAddressString in the cases where no parsing is provided, the address exists alreadyIPAddressgetProviderHostAddress()default IPAddress.IPVersiongetProviderIPVersion()default IPAddressgetProviderMask()default java.lang.IntegergetProviderNetworkPrefixLength()default IPAddressSeqRangegetProviderSeqRange()IPAddressProvider.IPTypegetType()default booleanhasPrefixSeparator()default booleanisInvalid()default booleanisProvidingAllAddresses()default booleanisProvidingBase85IPv6()default booleanisProvidingEmpty()default booleanisProvidingIPAddress()default booleanisProvidingIPv4()default booleanisProvidingIPv6()default booleanisProvidingMixedIPv6()default booleanisProvidingPrefixOnly()default booleanisSequential()default booleanisUninitialized()default java.lang.BooleanparsedEquals(IPAddressProvider other)An optimized equality comparison that does not need to create addresses to return an answer.default java.lang.BooleanprefixContains(IPAddressProvider other)An optimized prefix comparison that does not need to create addresses to return an answer.default java.lang.BooleanprefixContains(java.lang.String other)An optimized prefix comparison that does not need to create addresses to return an answer.default java.lang.BooleanprefixEquals(IPAddressProvider other)An optimized prefix comparison that does not need to create addresses to return an answer.default java.lang.BooleanprefixEquals(java.lang.String other)An optimized prefix comparison that does not need to fully parse the other address to return an answer.default intproviderCompare(IPAddressProvider other)default booleanproviderEquals(IPAddressProvider other)When a value provider produces no value, equality and comparison are based on the enum IPType, which can by null.default intproviderHashCode()
-
-
-
Field Detail
-
INVALID_PROVIDER
static final IPAddressProvider.NullProvider INVALID_PROVIDER
-
NO_TYPE_PROVIDER
static final IPAddressProvider.NullProvider NO_TYPE_PROVIDER
-
EMPTY_PROVIDER
static final IPAddressProvider.NullProvider EMPTY_PROVIDER
-
-
Method Detail
-
getType
IPAddressProvider.IPType getType()
-
getProviderHostAddress
IPAddress getProviderHostAddress() throws IncompatibleAddressException
- Throws:
IncompatibleAddressException
-
getProviderAddress
IPAddress getProviderAddress() throws IncompatibleAddressException
- Throws:
IncompatibleAddressException
-
getProviderAddress
IPAddress getProviderAddress(IPAddress.IPVersion version) throws IncompatibleAddressException
- Throws:
IncompatibleAddressException
-
isSequential
default boolean isSequential()
-
getProviderSeqRange
default IPAddressSeqRange getProviderSeqRange()
-
getProviderMask
default IPAddress getProviderMask()
-
getDivisionGrouping
default IPAddressDivisionSeries getDivisionGrouping() throws IncompatibleAddressException
- Throws:
IncompatibleAddressException
-
providerCompare
default int providerCompare(IPAddressProvider other) throws IncompatibleAddressException
- Throws:
IncompatibleAddressException
-
providerEquals
default boolean providerEquals(IPAddressProvider other) throws IncompatibleAddressException
When a value provider produces no value, equality and comparison are based on the enum IPType, which can by null.- Parameters:
o-- Returns:
- Throws:
IncompatibleAddressException
-
providerHashCode
default int providerHashCode() throws IncompatibleAddressException- Throws:
IncompatibleAddressException
-
getProviderIPVersion
default IPAddress.IPVersion getProviderIPVersion()
-
isProvidingIPAddress
default boolean isProvidingIPAddress()
-
isProvidingIPv4
default boolean isProvidingIPv4()
-
isProvidingIPv6
default boolean isProvidingIPv6()
-
isProvidingPrefixOnly
default boolean isProvidingPrefixOnly()
-
isProvidingAllAddresses
default boolean isProvidingAllAddresses()
-
isProvidingEmpty
default boolean isProvidingEmpty()
-
isProvidingMixedIPv6
default boolean isProvidingMixedIPv6()
-
isProvidingBase85IPv6
default boolean isProvidingBase85IPv6()
-
getProviderNetworkPrefixLength
default java.lang.Integer getProviderNetworkPrefixLength()
-
isInvalid
default boolean isInvalid()
-
isUninitialized
default boolean isUninitialized()
-
contains
default java.lang.Boolean contains(IPAddressProvider other)
An 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.- Parameters:
other-- Returns:
-
contains
default java.lang.Boolean contains(java.lang.String other)
An 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.- Parameters:
other-- Returns:
-
prefixEquals
default java.lang.Boolean prefixEquals(java.lang.String other)
An 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.- Parameters:
other-- Returns:
-
prefixEquals
default java.lang.Boolean prefixEquals(IPAddressProvider other)
An 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.- Parameters:
other-- Returns:
-
prefixContains
default java.lang.Boolean prefixContains(java.lang.String other)
An 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.- Parameters:
other-- Returns:
-
prefixContains
default java.lang.Boolean prefixContains(IPAddressProvider other)
An 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.- Parameters:
other-- Returns:
-
parsedEquals
default java.lang.Boolean parsedEquals(IPAddressProvider other)
An 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.- Parameters:
other-- Returns:
-
hasPrefixSeparator
default boolean hasPrefixSeparator()
-
getParameters
default IPAddressStringParameters getParameters()
If the address was created by parsing, this provides the parameters used when creating the address.- Returns:
- the parameters used to create the address, or null if no such parameters were used.
-
getProviderFor
static IPAddressProvider getProviderFor(IPAddress address, IPAddress hostAddress)
Wraps an IPAddress for IPAddressString in the cases where no parsing is provided, the address exists already- Parameters:
value-- Returns:
-
-