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.
Use CidrAddress instead.
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

    Fields
    Modifier and Type
    Field
    Description
    static final CidrAddress
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.INET4_ANY_CIDR instead.
    static final CidrAddress
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.INET6_ANY_CIDR instead.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareAddressBytesTo(byte[] otherBytes, int otherNetmaskBits, int scopeId)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    create(byte[] addressBytes, int netmaskBits)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.create(byte[], int) instead.
    create(InetAddress networkAddress, int netmaskBits)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.create(InetAddress, int) instead.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    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.
    Use CidrAddress.getBroadcastAddress() instead.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.getNetmaskBits() instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.getNetworkAddress() instead.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.getScopeId() instead.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    matches(byte[] bytes)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.matches(byte[]) instead.
    boolean
    matches(byte[] bytes, int scopeId)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.matches(byte[], int) instead.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.matches(Inet4Address) instead.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.matches(Inet6Address) instead.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.matches(InetAddress) instead.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use CidrAddress.matches(io.smallrye.common.net.CidrAddress) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • INET4_ANY_CIDR

      @Deprecated(forRemoval=true) public static final CidrAddress INET4_ANY_CIDR
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.INET4_ANY_CIDR instead.
      The CIDR address representing all IPv4 addresses.
    • INET6_ANY_CIDR

      @Deprecated(forRemoval=true) public static final CidrAddress INET6_ANY_CIDR
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.INET6_ANY_CIDR instead.
      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.
      Use CidrAddress.create(InetAddress, int) instead.
      Create a new CIDR address.
      Parameters:
      networkAddress - the network address (must not be null)
      netmaskBits - the netmask bits (0-32 for IPv4, or 0-128 for IPv6)
      Returns:
      the CIDR address (not null)
    • create

      @Deprecated(forRemoval=true) public static CidrAddress create(byte[] addressBytes, int netmaskBits)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.create(byte[], int) instead.
      Create a new CIDR address.
      Parameters:
      addressBytes - the network address bytes (must not be null, 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(forRemoval=true) public boolean matches(InetAddress address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.matches(InetAddress) instead.
      Determine if this CIDR address matches the given address.
      Parameters:
      address - the address to test
      Returns:
      true if the address matches, false otherwise
    • matches

      @Deprecated(forRemoval=true) public boolean matches(byte[] bytes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.matches(byte[]) instead.
      Determine if this CIDR address matches the given address bytes.
      Parameters:
      bytes - the address bytes to test
      Returns:
      true if the address bytes match, false otherwise
    • matches

      @Deprecated(forRemoval=true) public boolean matches(byte[] bytes, int scopeId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.matches(byte[], int) instead.
      Determine if this CIDR address matches the given address bytes.
      Parameters:
      bytes - the address bytes to test
      scopeId - the scope ID, or 0 to match no scope
      Returns:
      true if the address bytes match, false otherwise
    • matches

      @Deprecated(forRemoval=true) public boolean matches(Inet4Address address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.matches(Inet4Address) instead.
      Determine if this CIDR address matches the given address.
      Parameters:
      address - the address to test
      Returns:
      true if the address matches, false otherwise
    • matches

      @Deprecated(forRemoval=true) public boolean matches(Inet6Address address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.matches(Inet6Address) instead.
      Determine if this CIDR address matches the given address.
      Parameters:
      address - the address to test
      Returns:
      true if the address matches, false otherwise
    • matches

      @Deprecated(forRemoval=true) public boolean matches(CidrAddress address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.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:
      true if the given block is enclosed by this one, false otherwise
    • getNetworkAddress

      @Deprecated(forRemoval=true) public InetAddress getNetworkAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.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(forRemoval=true) public Inet4Address getBroadcastAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.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) then null is returned.
      Returns:
      the broadcast address for this CIDR block, or null if there is none
    • getNetmaskBits

      @Deprecated(forRemoval=true) public int getNetmaskBits()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.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(forRemoval=true) public int getScopeId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use CidrAddress.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

      public int compareTo(CidrAddress other)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      compareTo in interface Comparable<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

      public boolean equals(Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
    • equals

      public boolean equals(CidrAddress obj)
      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.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object