I have a variable in a class:
public final class Things {
public static final Thing OBJECT = new Thing();
}
I access it in various places with:
Things.OBJECT.someCoolMethod();
I want to use it like this:
Things.getObject().someCoolMethod();
How can I acheive this automatically with refactoring? I dont want to have to go through each class accessing it manually (Its a huge project)
Thanks for your help!
After some digging I found a solution. Hope that this will help other adventurers further down the road too.
Right click variable > Refactor > Encapsulate Fields... > Getter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With