How to generate multiple getter functions for the same variable via multiple templates?

Answered

This is related to Android Studio/IntelliJ.
Currently Android Studio allows to auto generate Getter functions.

I have created a custom getter template. Now how to generate both IntelliJ Default Getter template and the custom getter template?

As I see currently once the IntelliJ default getter template is created for all data members of the class android studio does not allow to again generate the getter functions with my custom template. `"No fields without getter found"` error is generated.

Can't we create another custom method generation for all data members other than `Getter / Setter / equals / hashcode / toString`?

1
3 comments

You can create custom code generations using your own plug-in. Please check how toString open source plug-in is implemented for the reference.

0
Avatar
Permanently deleted user

Hi Serge

Can you provide a sample open source code/link for toString plugin?

or any preferred tutorial link to create a plugin to serve my local purpose?

0

Please sign in to leave a comment.