Record Class Inet.V6

java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Inet.V6
Record Components:
w1 - First 32 bits of the IPv6 address in big-endian order.
w2 - Second 32 bits of the IPv6 address in big-endian order.
w3 - Third 32 bits of the IPv6 address in big-endian order.
w4 - Fourth 32 bits of the IPv6 address in big-endian order.
netmask - Network mask length in the range 0–128.
All Implemented Interfaces:
Inet
Enclosing interface:
Inet

public static record Inet.V6(int w1, int w2, int w3, int w4, byte netmask) extends Record implements Inet
IPv6 host address with optional subnet mask.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.codemine.java.postgresql.codecs.Inet

    Inet.V4, Inet.V6
  • Constructor Summary

    Constructors
    Constructor
    Description
    V6(int w1, int w2, int w3, int w4, byte netmask)
    Creates an instance of a V6 record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the PostgreSQL text representation of this address to sb.
    void
    Encodes this address in PostgreSQL binary wire format into out.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    byte
    Returns the value of the netmask record component.
    static Inet.V6
    Creates an Inet.V6 from a Inet6Address with a full host netmask ( /128).
    Returns the address part of this value as a Inet6Address.
    Returns a string representation of this record class.
    int
    w1()
    Returns the value of the w1 record component.
    int
    w2()
    Returns the value of the w2 record component.
    int
    w3()
    Returns the value of the w3 record component.
    int
    w4()
    Returns the value of the w4 record component.

    Methods inherited from class java.lang.Object

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

    • V6

      public V6(int w1, int w2, int w3, int w4, byte netmask)
      Creates an instance of a V6 record class.
      Parameters:
      w1 - the value for the w1 record component
      w2 - the value for the w2 record component
      w3 - the value for the w3 record component
      w4 - the value for the w4 record component
      netmask - the value for the netmask record component
  • Method Details

    • of

      public static Inet.V6 of(Inet6Address addr)
      Creates an Inet.V6 from a Inet6Address with a full host netmask ( /128).
      Parameters:
      addr - the IPv6 address
    • toInetAddress

      public Inet6Address toInetAddress()
      Returns the address part of this value as a Inet6Address. The netmask is not represented in the returned object.
      Specified by:
      toInetAddress in interface Inet
    • appendInTextTo

      public void appendInTextTo(StringBuilder sb)
      Description copied from interface: Inet
      Appends the PostgreSQL text representation of this address to sb.
      Specified by:
      appendInTextTo in interface Inet
    • encodeInBinary

      public void encodeInBinary(ByteArrayOutputStream out)
      Description copied from interface: Inet
      Encodes this address in PostgreSQL binary wire format into out.
      Specified by:
      encodeInBinary in interface Inet
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • w1

      public int w1()
      Returns the value of the w1 record component.
      Returns:
      the value of the w1 record component
    • w2

      public int w2()
      Returns the value of the w2 record component.
      Returns:
      the value of the w2 record component
    • w3

      public int w3()
      Returns the value of the w3 record component.
      Returns:
      the value of the w3 record component
    • w4

      public int w4()
      Returns the value of the w4 record component.
      Returns:
      the value of the w4 record component
    • netmask

      public byte netmask()
      Returns the value of the netmask record component.
      Returns:
      the value of the netmask record component