Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review: doc: highlight for CtRecordComponent that return values are views #5287

Merged
merged 7 commits into from
Jun 19, 2023
16 changes: 12 additions & 4 deletions src/main/java/spoon/reflect/declaration/CtRecordComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@
public interface CtRecordComponent extends CtTypedElement<Object>, CtNamedElement, CtShadowable {

/**
* Converts the component to an implicit method.
* @return the method
* Converts the component to an implicit method. The returned method is a view and has no parent.
* This means that any modification on the returned method will not be reflected on the component.
* Also this element <b> is not </b> part of the model. A record already has the methods corresponding to its components.
MartinWitt marked this conversation as resolved.
Show resolved Hide resolved
* Use {@link CtRecord#getMethods()} to get the getter methods of a record.
*
* @return the method corresponding to the component (a getter) as a view.
*/
CtMethod<?> toMethod();

/**
* Converts the component to an implicit field.
* @return the field
* Converts the component to an implicit field.The returned field is a view and has <b>no</b> parent.
* This means that any modification on the returned field will not be reflected on the component.
* Also this element <b> is not </b> part of the model. A record already has the field corresponding to its components.
MartinWitt marked this conversation as resolved.
Show resolved Hide resolved
* Use {@link CtRecord#getFields()} to get the field of a record.
MartinWitt marked this conversation as resolved.
Show resolved Hide resolved
*
* @return the field corresponding to the component as a view.
MartinWitt marked this conversation as resolved.
Show resolved Hide resolved
*/
CtField<?> toField();

Expand Down