Package com.jerolba.carpet.impl.write
Record Class RecordField
java.lang.Object
java.lang.Record
com.jerolba.carpet.impl.write.RecordField
public record RecordField(Class<?> targetClass, RecordComponent recordComponent, String fieldName, int idx)
extends Record
-
Constructor Summary
ConstructorDescriptionRecordField
(Class<?> targetClass, RecordComponent recordComponent, String fieldName, int idx) Creates an instance of aRecordField
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefieldName
record component.final int
hashCode()
Returns a hash code value for this object.int
idx()
Returns the value of theidx
record component.Returns the value of therecordComponent
record component.Class<?>
Returns the value of thetargetClass
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
RecordField
public RecordField(Class<?> targetClass, RecordComponent recordComponent, String fieldName, int idx) Creates an instance of aRecordField
record class.- Parameters:
targetClass
- the value for thetargetClass
record componentrecordComponent
- the value for therecordComponent
record componentfieldName
- the value for thefieldName
record componentidx
- the value for theidx
record component
-
-
Method Details
-
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 '=='. -
targetClass
Returns the value of thetargetClass
record component.- Returns:
- the value of the
targetClass
record component
-
recordComponent
Returns the value of therecordComponent
record component.- Returns:
- the value of the
recordComponent
record component
-
fieldName
Returns the value of thefieldName
record component.- Returns:
- the value of the
fieldName
record component
-
idx
public int idx()Returns the value of theidx
record component.- Returns:
- the value of the
idx
record component
-