Record Class RecordComponent
java.lang.Object
java.lang.Record
net.covers1624.coffeegrinder.type.RecordComponent
- Record Components:
owner- The class which declared this component.name- The name of the component, must be consistent with the field and accessor names.type- The type of this component.field- The field backing this component.accessor- The accessor for this component.isVarargs- If this component is the last parameter in the canonical constructor and is marked as varargs.annotations- The annotations for the component.
public record RecordComponent(ClassType owner, String name, AType type, Field field, Method accessor, boolean isVarargs, RecordComponent.Annotations annotations)
extends Record
Represents a class record component.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents the annotations of a RecordComponent. -
Constructor Summary
ConstructorsConstructorDescriptionRecordComponent(ClassType owner, String name, AType type, Field field, Method accessor, boolean isVarargs, RecordComponent.Annotations annotations) Creates an instance of aRecordComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaccessor()Returns the value of theaccessorrecord component.Returns the value of theannotationsrecord component.final booleanIndicates whether some other object is "equal to" this one.field()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisVarargsrecord component.name()Returns the value of thenamerecord component.owner()Returns the value of theownerrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
RecordComponent
public RecordComponent(ClassType owner, String name, AType type, Field field, Method accessor, boolean isVarargs, RecordComponent.Annotations annotations) Creates an instance of aRecordComponentrecord class.- Parameters:
owner- the value for theownerrecord componentname- the value for thenamerecord componenttype- the value for thetyperecord componentfield- the value for thefieldrecord componentaccessor- the value for theaccessorrecord componentisVarargs- the value for theisVarargsrecord componentannotations- the value for theannotationsrecord 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 '=='. -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
field
Returns the value of thefieldrecord component.- Returns:
- the value of the
fieldrecord component
-
accessor
Returns the value of theaccessorrecord component.- Returns:
- the value of the
accessorrecord component
-
isVarargs
public boolean isVarargs()Returns the value of theisVarargsrecord component.- Returns:
- the value of the
isVarargsrecord component
-
annotations
Returns the value of theannotationsrecord component.- Returns:
- the value of the
annotationsrecord component
-