Package io.datarouter.bytes
Record Class RecordByteArrayField
java.lang.Object
java.lang.Record
io.datarouter.bytes.RecordByteArrayField
Explicitly for storing byte arrays as java record fields.
Please do not add other functionality.
Java records use shallow hashCode/equals on byte arrays.
Using this wrapper in a record will result in deep hashCode/equals.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRecordByteArrayField(byte[] bytes) Creates an instance of aRecordByteArrayFieldrecord class. -
Method Summary
-
Field Details
-
EMPTY
-
-
Constructor Details
-
RecordByteArrayField
public RecordByteArrayField(byte[] bytes) Creates an instance of aRecordByteArrayFieldrecord class.- Parameters:
bytes- the value for thebytesrecord component
-
-
Method Details
-
hashCode
-
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 withObjects::equals(Object,Object). -
toString
-
bytes
public byte[] bytes()Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-