KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I just noticed something I didn't know. private boolean isCertified; public boolean isCertified() { return isCertified; } public void setCertified(boolean certified) { isCertified = certified; } The following getters and setters have been generated by Intellij. By the way, Lombok generate the same kind of getters and setters. I would have expected something like: private boolean isCertified; public boolean isIsCertified() { return isCertified; } public void setIsCertified(boolean certified) { isCertified = certified; } That's why I usually don't prefix my boolean attributes with ìs , despites the fact I think the property name becomes more readable. I normally write something like: private boolean certified; public boolean isCertified() { return certified; } public void setCertified(boolean certified) { certified = certified; } So I wonder: Having a property named isXXX and a getter being isXXX instead of isIsXXX : is it a valid Java Bean definition? Are there any other hidden Java Bean corner cases like that, that I may want to know to improve the code readability? Thanks
Tags (comma-separated)
Save Edits
Cancel