OpenPojo / openpojo

POJO Testing & Identity Management Made Trivial
http://openpojo.com
Apache License 2.0
156 stars 40 forks source link

getter/setter should support has prefix #67

Open drdamour opened 9 years ago

drdamour commented 9 years ago

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

oshoukry commented 9 years ago

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.

drdamour commented 9 years ago

why are you quoting beans when the lib is called open pojo? On Oct 10, 2015 3:39 PM, "Osman Shoukry" notifications@github.com 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.