Interface Cidr

All Known Implementing Classes:
Cidr.V4, Cidr.V6

public sealed interface Cidr permits Cidr.V4, Cidr.V6
PostgreSQL cidr type. Represents a network address — an IPv4 or IPv6 address whose host bits are all zero.

Unlike Inet, which can hold an arbitrary host address with an optional subnet mask, a cidr value always denotes a network: the address stored is the network address itself (all host bits are zero), and the netmask is required.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    IPv4 CIDR block.
    static final record 
    IPv6 CIDR block.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the PostgreSQL text representation of this CIDR block to sb.
    void
    Encodes this CIDR block in PostgreSQL binary wire format into out.
  • Method Details

    • appendInTextTo

      void appendInTextTo(StringBuilder sb)
      Appends the PostgreSQL text representation of this CIDR block to sb.
    • encodeInBinary

      void encodeInBinary(ByteArrayOutputStream out)
      Encodes this CIDR block in PostgreSQL binary wire format into out.