I know that the convention in Java for boolean getters is include the prefix "is".
isEnabled
isStoreOpen
But what if the subject is plural? That is, what if instead of wanting to know if a store is open, I wanted to know if all the stores are open?
isStoresOpen()
doesn't make sense in English.
I'm tempted to write getters like:
areStoresOpen
areDogsCute
areCatsFuzzy
And I think that would make sense, but I've been told by others that I should just suck it up and abandon subject verb agreement and use isStoresOpen
, isDogsCute
, isCatsFuzzy
.
Anyway, what should I do for boolean getters which operate on a plural subject?
How about having decent enough english and following Java standard:
areStoresOpen()
could be isEveryStoreOpen()
areCatsCute()
could be isEachCatCute()
When in doubt of the right word I always like to hit up the thesaurus.
These days AI might could also be used to suggest something clever.