In Java, by convention getter and setter for boolean fields will be
setField(). This works perfectly fine with field names that are adjectives like
But how do I name a field that has meaning of a verb, like
haveChildren? Add “_ing” to the verb (
To clarify, I don't have control of the method names (getter and setter) as they are auto-generated by the IDE. So what I need is an appropriate field name so that when the IDE generate a getter for it, it make senses. For example,
hasChildren is a perfect field name, but when the IDE generate the getter for the field it would be
isHasChildren. How do I solve this?