openpojo icon indicating copy to clipboard operation
openpojo copied to clipboard

getter/setter should support has prefix

Open drdamour opened this issue 9 years ago • 2 comments

lots of bool fields on pojos start with hasXXX instead of getHas

ie

private boolean hasStuff public boolean hasStuff(){return hasStuff} public void setHasStuff(boolean hasStuff){this.hasStuff = hasStuff}

i think this should be supported by default

drdamour avatar Oct 07 '15 17:10 drdamour

According to the JavaBean spec boolean fields are only allowed an "is"<Name> or "get"<Name>. if I add has, was, should, must and other assertive keywords for getters it would not confirm to the naming standard.

see http://www.oracle.com/technetwork/java/javase/overview/spec-136004.html

Perhaps a compromise would be to open up some flexibility to allow you to set your own list to be used, but having it as default behavior would not be acceptable. I will add this flexibility if there is a popular demand for such flexibility in the framework.

oshoukry avatar Oct 10 '15 21:10 oshoukry

why are you quoting beans when the lib is called open pojo? On Oct 10, 2015 3:39 PM, "Osman Shoukry" [email protected] wrote:

According to the JavaBean spec boolean fields are only allowed an "is" or "get". if I add has, was, should, must and other assertive keywords for getters it would not confirm to the naming standard.

see http://www.oracle.com/technetwork/java/javase/overview/spec-136004.html

Perhaps a compromise would be to open up some flexibility to allow you to set your own list to be used, but having it as default behavior would not be acceptable. I will add this flexibility if there is a popular demand for such flexibility in the framework.

— Reply to this email directly or view it on GitHub https://github.com/oshoukry/openpojo/issues/67#issuecomment-147127616.

drdamour avatar Oct 10 '15 22:10 drdamour