Class Cidr

java.lang.Object
org.apache.activemq.util.Cidr

public final class Cidr extends Object
An IPv4 or IPv6 network block in CIDR notation.

Plain class rather than a record: the activemq-spring schema generator parses this module's sources with QDox 1.x, which does not understand record declarations and fails the activemq-spring build on one.

  • Constructor Details

    • Cidr

      public Cidr(String cidr, byte[] networkAddress, byte[] mask)
  • Method Details

    • cidr

      public String cidr()
      the block as written, e.g. 192.168.1.0/24
    • networkAddress

      public byte[] networkAddress()
      the network address with the mask applied
    • mask

      public byte[] mask()
    • prefixLength

      public int prefixLength()
      number of leading one bits in the mask, i.e. the prefix length after the slash
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object