Record Class Macaddr
java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Macaddr
PostgreSQL
macaddr type. MAC (Media Access Control) address.
Represents a 6-byte MAC address stored as six individual bytes. The canonical text format is
xx:xx:xx:xx:xx:xx in lower-case hexadecimal.
-
Constructor Summary
ConstructorsConstructorDescriptionMacaddr(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6) Creates an instance of aMacaddrrecord 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.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Macaddrof(byte[] bytes) Creates aMacaddrfrom a 6-byte array.byte[]toBytes()Returns the 6 bytes of this MAC address as a new byte array.toString()Returns a string representation of this record class.
-
Constructor Details
-
Macaddr
public Macaddr(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6) Creates an instance of aMacaddrrecord 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 component
-
-
Method Details
-
of
Creates aMacaddrfrom a 6-byte array.- Parameters:
bytes- a 6-byte MAC address; the array is not retained- Throws:
IllegalArgumentException- if the array length is not 6
-
toBytes
public byte[] toBytes()Returns the 6 bytes of this MAC address as a new byte array.- Returns:
- a fresh 6-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
-