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

[FEATURE] After using @RequiredArgsConstructor, the subclass constructor depends on the constructor generated by @RequiredArgsConstructor. #3818

Open
tangwangwang opened this issue Feb 6, 2025 · 0 comments

Comments

@tangwangwang
Copy link

tangwangwang commented Feb 6, 2025

When a class has a large number of final properties, @RequiredArgsConstructor can elegantly help generate the constructor. However, when this class has subclasses, the subclass constructor must call the constructor generated by @RequiredArgsConstructor in the parent class. Since it is automatically generated, the order and number of parameters need to be manually adjusted. I hope @RequiredArgsConstructor can add an attribute to support checking final fields in the parent class, or alternatively, introduce a new annotation for this purpose. I believe you can easily implement this. Many thanks! 🙏 Elegance never goes out of style.

@tangwangwang tangwangwang changed the title [FEATURE] 使用@RequiredArgsConstructor后,子类构造方法依赖@RequiredArgsConstructor生成的构造方法 [FEATURE] After using @RequiredArgsConstructor, the subclass constructor depends on the constructor generated by @RequiredArgsConstructor. Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant