Package com.jerolba.carpet.impl.write
Record Class ReflectionRecordField
java.lang.Object
java.lang.Record
com.jerolba.carpet.impl.write.ReflectionRecordField
public record ReflectionRecordField(Class<?> targetClass, RecordComponent recordComponent, String fieldName, int idx)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionReflectionRecordField(Class<?> targetClass, RecordComponent recordComponent, String fieldName, int idx) Creates an instance of aReflectionRecordFieldrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldNamerecord component.final inthashCode()Returns a hash code value for this object.intidx()Returns the value of theidxrecord component.Returns the value of therecordComponentrecord component.Class<?>Returns the value of thetargetClassrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ReflectionRecordField
public ReflectionRecordField(Class<?> targetClass, RecordComponent recordComponent, String fieldName, int idx) Creates an instance of aReflectionRecordFieldrecord class.- Parameters:
targetClass- the value for thetargetClassrecord componentrecordComponent- the value for therecordComponentrecord componentfieldName- the value for thefieldNamerecord componentidx- the value for theidxrecord component
-
-
Method Details
-
getAccessor
-
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 thetargetClassrecord component.- Returns:
- the value of the
targetClassrecord component
-
recordComponent
Returns the value of therecordComponentrecord component.- Returns:
- the value of the
recordComponentrecord component
-
fieldName
Returns the value of thefieldNamerecord component.- Returns:
- the value of the
fieldNamerecord component
-
idx
public int idx()Returns the value of theidxrecord component.- Returns:
- the value of the
idxrecord component
-