Package io.datarouter.bytes
Record Class LengthAndValue<T>
java.lang.Object
java.lang.Record
io.datarouter.bytes.LengthAndValue<T>
-
Constructor Summary
ConstructorsConstructorDescriptionLengthAndValue(int length, T value) Creates an instance of aLengthAndValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionassertLengthEquals(int expectedLength) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlength()Returns the value of thelengthrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
LengthAndValue
Creates an instance of aLengthAndValuerecord class.- Parameters:
length- the value for thelengthrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
assertLengthEquals
-
toString
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
length
public int length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-