Package org.wildfly.common.net
Class CidrAddress
java.lang.Object
org.wildfly.common.net.CidrAddress
- All Implemented Interfaces:
Serializable,Comparable<CidrAddress>
@Deprecated(forRemoval=true)
public final class CidrAddress
extends Object
implements Serializable, Comparable<CidrAddress>
Deprecated, for removal: This API element is subject to removal in a future version.
A Classless Inter-Domain Routing address. This is the combination of an IP address and a netmask.
- Author:
- David M. Lloyd
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CidrAddressDeprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.INET4_ANY_CIDRinstead.static final CidrAddressDeprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.INET6_ANY_CIDRinstead. -
Method Summary
Modifier and TypeMethodDescriptionintcompareAddressBytesTo(byte[] otherBytes, int otherNetmaskBits, int scopeId) Deprecated, for removal: This API element is subject to removal in a future version.intcompareTo(CidrAddress other) Deprecated, for removal: This API element is subject to removal in a future version.static CidrAddresscreate(byte[] addressBytes, int netmaskBits) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.create(byte[], int)instead.static CidrAddresscreate(InetAddress networkAddress, int netmaskBits) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.create(InetAddress, int)instead.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanequals(CidrAddress obj) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getBroadcastAddress()instead.intDeprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getNetmaskBits()instead.Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getNetworkAddress()instead.intDeprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getScopeId()instead.inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.booleanmatches(byte[] bytes) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(byte[])instead.booleanmatches(byte[] bytes, int scopeId) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(byte[], int)instead.booleanmatches(Inet4Address address) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(Inet4Address)instead.booleanmatches(Inet6Address address) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(Inet6Address)instead.booleanmatches(InetAddress address) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(InetAddress)instead.booleanmatches(CidrAddress address) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(io.smallrye.common.net.CidrAddress)instead.toString()Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
INET4_ANY_CIDR
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.INET4_ANY_CIDRinstead.The CIDR address representing all IPv4 addresses. -
INET6_ANY_CIDR
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.INET6_ANY_CIDRinstead.The CIDR address representing all IPv6 addresses.
-
-
Method Details
-
create
@Deprecated(forRemoval=true) public static CidrAddress create(InetAddress networkAddress, int netmaskBits) Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.create(InetAddress, int)instead.Create a new CIDR address.- Parameters:
networkAddress- the network address (must not benull)netmaskBits- the netmask bits (0-32 for IPv4, or 0-128 for IPv6)- Returns:
- the CIDR address (not
null)
-
create
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.create(byte[], int)instead.Create a new CIDR address.- Parameters:
addressBytes- the network address bytes (must not benull, must be 4 bytes for IPv4 or 16 bytes for IPv6)netmaskBits- the netmask bits (0-32 for IPv4, or 0-128 for IPv6)- Returns:
- the CIDR address (not
null)
-
matches
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(InetAddress)instead.Determine if this CIDR address matches the given address.- Parameters:
address- the address to test- Returns:
trueif the address matches,falseotherwise
-
matches
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(byte[])instead.Determine if this CIDR address matches the given address bytes.- Parameters:
bytes- the address bytes to test- Returns:
trueif the address bytes match,falseotherwise
-
matches
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(byte[], int)instead.Determine if this CIDR address matches the given address bytes.- Parameters:
bytes- the address bytes to testscopeId- the scope ID, or 0 to match no scope- Returns:
trueif the address bytes match,falseotherwise
-
matches
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(Inet4Address)instead.Determine if this CIDR address matches the given address.- Parameters:
address- the address to test- Returns:
trueif the address matches,falseotherwise
-
matches
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(Inet6Address)instead.Determine if this CIDR address matches the given address.- Parameters:
address- the address to test- Returns:
trueif the address matches,falseotherwise
-
matches
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.matches(io.smallrye.common.net.CidrAddress)instead.Determine if this CIDR address matches the given CIDR address. This will be true only when the given CIDR block is wholly enclosed by this one.- Parameters:
address- the address to test- Returns:
trueif the given block is enclosed by this one,falseotherwise
-
getNetworkAddress
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getNetworkAddress()instead.Get the network address. The returned address has a resolved name consisting of the most compact valid string representation of the network of this CIDR address.- Returns:
- the network address (not
null)
-
getBroadcastAddress
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getBroadcastAddress()instead.Get the broadcast address for this CIDR block. If the block has no broadcast address (either because it is IPv6 or it is too small) thennullis returned.- Returns:
- the broadcast address for this CIDR block, or
nullif there is none
-
getNetmaskBits
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getNetmaskBits()instead.Get the netmask bits. This will be in the range 0-32 for IPv4 addresses, and 0-128 for IPv6 addresses.- Returns:
- the netmask bits
-
getScopeId
Deprecated, for removal: This API element is subject to removal in a future version.UseCidrAddress.getScopeId()instead.Get the match address scope ID (if it is an IPv6 address).- Returns:
- the scope ID, or 0 if there is none or the address is an IPv4 address
-
compareTo
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
compareToin interfaceComparable<CidrAddress>
-
compareAddressBytesTo
public int compareAddressBytesTo(byte[] otherBytes, int otherNetmaskBits, int scopeId) Deprecated, for removal: This API element is subject to removal in a future version. -
equals
Deprecated, for removal: This API element is subject to removal in a future version. -
equals
Deprecated, for removal: This API element is subject to removal in a future version. -
hashCode
public int hashCode()Deprecated, for removal: This API element is subject to removal in a future version. -
toString
Deprecated, for removal: This API element is subject to removal in a future version.
-
CidrAddressinstead.