Boolean, logical attributes have improved semantics in the getter when generated automatically by the IDE.
Maybe with an attribute of status
is not the best case. Think of the getter property of the administrador
property.
private boolean administrador;
public boolean isAdministrador() { ... }
It is semantically better for getters of logical objects to have the prefix is
in particular cases.
Also keep in mind that the getPropriedade
and setPropriedade
pattern is not a rule.
This is not just for getters . Imagine a Pessoa
class with a estadoCivil
attribute. See the semantic advantage of the setter of estadoCivil
be casar()
or divorciar()
?
Either way, you can disable this Eclipse configuration in Settings > Code Style > Java > Use 'is' prefix for getters that return boolean.