mirror of
https://github.com/tiennm99/lombok.git
synced 2026-09-19 06:21:03 +00:00
a9d29896887ee35903bcb847eb4307637801bcc2
If boolean fields already start with a typical getter prefix (is, has, or get), lombok's @Getter will no longer generate its own prefix as well, so a field named 'hasFoo' will result in a getter named 'hasFoo()', not 'isHasFoo()'. Also, if any likely getter name already exists for a boolean, a getter will not be generated. Thus, if your field is called 'hasFoo', and you already have a method named 'isFoo', then @Getter will not generate anything (and warn, unless the getter is being generated due to @Data). This last mechanism works by taking the field name *AND* any other likely base names (defined by the field name being named as prefix+baseName, with prefix being is/has/get), and then prefixing all the likely fieldnames with is/has/get, and checking if any method with that name exists. Of course, this means weird things are going to happen if you have 2 fields named 'isFoo' and 'hasFoo', but then, you'd be a real idiot if you did that.
projectlombok makes java a spicier language by adding 'handlers' that know how to build and compile simple, boilerplate-free, not-quite-java code. Using lombok is made as simple as possible, and aims to work on all major java IDEs as well as javac itself. See LICENCE for the project lombok licence. Project Authors: Reinier Zwitserloot twitter: @surial home: http://zwitserloot.com/ Roel Spilker twitter: @rspilker
Languages
Java
94.5%
HTML
4.8%
JavaScript
0.3%
CSS
0.2%