Question: Maintain naming standard for variables with Lombok @Getter AND @Setter

Question

Maintain naming standard for variables with Lombok @Getter AND @Setter

Answers 1
Added at 2016-11-25 01:11
Tags
Question

The code base I work with uses the naming standard for every local variable to start with an 's' or and 'f' e.g. fName or sName. When I use Lombok @Getter annotation with it, it ends up naming the functions as getFName() or getSName() which doesn't look pretty.

Do you have any advice or suggestions on how you guys maintain the naming guidelines/standards while using Lombok?

Answers to

Maintain naming standard for variables with Lombok @Getter AND @Setter

nr: #1 dodano: 2016-11-25 02:11

Create a lombok.config file in your project root with the following contents:

lombok.accessors.prefix += f
lombok.accessors.prefix += s

See here for lombok.accessors.prefix parameter description and here for instructions on lombok.config file usage.

Or better, if at all possible, get rid of this naming convention altogether.

Source Show
◀ Wstecz