Package dev.gmitch215.bytebox.io
Record Class SerialField
java.lang.Object
java.lang.Record
dev.gmitch215.bytebox.io.SerialField
- Record Components:
name- the field's nametypeCode- the JVM type code: one ofBCDFIJSZfor a primitive,Lfor a reference,[for an arraysignature- the JVM type signature for a reference or array, andnullfor a primitive
One field, as the serialization format describes it.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionSerialField(String name, char typeCode, String signature) Creates an instance of aSerialFieldrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanReturns whether this field is a primitive, which decides where it sorts and how it is written.Returns the value of thesignaturerecord component.final StringtoString()Returns a string representation of this record class.chartypeCode()Returns the value of thetypeCoderecord component.
-
Constructor Details
-
Method Details
-
primitive
public boolean primitive()Returns whether this field is a primitive, which decides where it sorts and how it is written.- Returns:
- whether this field is a primitive, which decides where it sorts and how it is written
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
typeCode
public char typeCode()Returns the value of thetypeCoderecord component.- Returns:
- the value of the
typeCoderecord component
-
signature
Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-