Naming convention for a getter of a boolean with a specific name?

java naming-conventions

87 观看

1回复

413 作者的声誉

I have the following member in a class:

private boolean requireColons;

I am aware that the convention is to prefix all boolean getters with is but isRequireColons() doesn't make sense. How should I name this?

作者: Michael Smith 的来源 发布者: 2017 年 12 月 27 日

回应 (1)


0

4769 作者的声誉

I would do

isColonsRequired

but if you're looking for the more grammatically correct (but less programmatically) alternative

areColonsRequired
作者: axsuul 发布者: 06.01.2018 11:31
32x32