Record Class Macaddr8

java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Macaddr8

public record Macaddr8(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8) extends Record
PostgreSQL macaddr8 type. An 8-byte MAC address (EUI-64).

The canonical text format is xx:xx:xx:xx:xx:xx:xx:xx in lower-case hexadecimal.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Macaddr8(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8)
    Creates an instance of a Macaddr8 record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    b1()
    Returns the value of the b1 record component.
    byte
    b2()
    Returns the value of the b2 record component.
    byte
    b3()
    Returns the value of the b3 record component.
    byte
    b4()
    Returns the value of the b4 record component.
    byte
    b5()
    Returns the value of the b5 record component.
    byte
    b6()
    Returns the value of the b6 record component.
    byte
    b7()
    Returns the value of the b7 record component.
    byte
    b8()
    Returns the value of the b8 record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static Macaddr8
    of(byte[] bytes)
    Creates a Macaddr8 from an 8-byte array.
    byte[]
    Returns the 8 bytes of this EUI-64 MAC address as a new byte array.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Macaddr8

      public Macaddr8(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8)
      Creates an instance of a Macaddr8 record class.
      Parameters:
      b1 - the value for the b1 record component
      b2 - the value for the b2 record component
      b3 - the value for the b3 record component
      b4 - the value for the b4 record component
      b5 - the value for the b5 record component
      b6 - the value for the b6 record component
      b7 - the value for the b7 record component
      b8 - the value for the b8 record component
  • Method Details

    • of

      public static Macaddr8 of(byte[] bytes)
      Creates a Macaddr8 from an 8-byte array.
      Parameters:
      bytes - an 8-byte EUI-64 MAC address; the array is not retained
      Throws:
      IllegalArgumentException - if the array length is not 8
    • toBytes

      public byte[] toBytes()
      Returns the 8 bytes of this EUI-64 MAC address as a new byte array.
      Returns:
      a fresh 8-byte array
    • 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.
    • b1

      public byte b1()
      Returns the value of the b1 record component.
      Returns:
      the value of the b1 record component
    • b2

      public byte b2()
      Returns the value of the b2 record component.
      Returns:
      the value of the b2 record component
    • b3

      public byte b3()
      Returns the value of the b3 record component.
      Returns:
      the value of the b3 record component
    • b4

      public byte b4()
      Returns the value of the b4 record component.
      Returns:
      the value of the b4 record component
    • b5

      public byte b5()
      Returns the value of the b5 record component.
      Returns:
      the value of the b5 record component
    • b6

      public byte b6()
      Returns the value of the b6 record component.
      Returns:
      the value of the b6 record component
    • b7

      public byte b7()
      Returns the value of the b7 record component.
      Returns:
      the value of the b7 record component
    • b8

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