The specification Javabeans determines patterns to be followed when writing Java objects.
In the version 1.0.1 specification, more precisely in the section 8.3.2 good practice is specified for boolean properties:
8.3.2 Boolean properties
In addition, for Boolean properties, we allow a getter method to match the Pattern:
public boolean is<PropertyName>();
This "is" method may be provided Instead of a "get" method, or it may be provided in
addition to a "get" method. In either case, if the
"is" method is present for a Boolean Property then we
will use the "is" method to read the Property value. An
example Boolean Property Might be:
public boolean isMarsupial();
public void setMarsupial(boolean m);
How the property is boolean, then the is improves the reading of getter.
Exemplifying:
- A class X has an attribute enabled of the kind Boolean
- true is for yes, as well as false is not to
- The is in English is equivalent to "is/is" in Portuguese
- isEnabled can be translated to English as: "is activated?"
Therefore, we can conclude that your IDE is creating the getters of booleans prefixed is instead of get because it is following the Spec Javabeans
Complementing my question, the declared variable is: private Boolean status;
– Diego
Perhaps because a Boolean attribute is usually defined to characterize the object as is/is not something. In this case, I would define it as "true state" or "false state", which doesn’t seem to make much sense. Change the name to "active" and you will see that it makes total sense to exist the method
isActive
.– Woss