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
ConstructorsConstructorDescriptionMacaddr8(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8) Creates an instance of aMacaddr8record class. -
Method Summary
Modifier and TypeMethodDescriptionbyteb1()Returns the value of theb1record component.byteb2()Returns the value of theb2record component.byteb3()Returns the value of theb3record component.byteb4()Returns the value of theb4record component.byteb5()Returns the value of theb5record component.byteb6()Returns the value of theb6record component.byteb7()Returns the value of theb7record component.byteb8()Returns the value of theb8record component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Macaddr8of(byte[] bytes) Creates aMacaddr8from an 8-byte array.byte[]toBytes()Returns the 8 bytes of this EUI-64 MAC address as a new byte array.toString()Returns a string representation of this record class.
-
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 aMacaddr8record class.- Parameters:
b1- the value for theb1record componentb2- the value for theb2record componentb3- the value for theb3record componentb4- the value for theb4record componentb5- the value for theb5record componentb6- the value for theb6record componentb7- the value for theb7record componentb8- the value for theb8record component
-
-
Method Details
-
of
Creates aMacaddr8from 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
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. -
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. -
equals
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 '=='. -
b1
public byte b1()Returns the value of theb1record component.- Returns:
- the value of the
b1record component
-
b2
public byte b2()Returns the value of theb2record component.- Returns:
- the value of the
b2record component
-
b3
public byte b3()Returns the value of theb3record component.- Returns:
- the value of the
b3record component
-
b4
public byte b4()Returns the value of theb4record component.- Returns:
- the value of the
b4record component
-
b5
public byte b5()Returns the value of theb5record component.- Returns:
- the value of the
b5record component
-
b6
public byte b6()Returns the value of theb6record component.- Returns:
- the value of the
b6record component
-
b7
public byte b7()Returns the value of theb7record component.- Returns:
- the value of the
b7record component
-
b8
public byte b8()Returns the value of theb8record component.- Returns:
- the value of the
b8record component
-