How to properly set getter setter in interface projection for a boolean variable starting with is?

Viewed 1772

I am using interface projection . For unit testing purpose i have to add both getter and setter. In Jpa query i have a Boolean parameter named isPublic. But getter setter not working. i tried following

  Boolean isPublic();

  void setPublic(Boolean isPublic);

and this

  Boolean getIsPublic();

  void setIsPublic(Boolean isPublic);

and this

  Boolean getPublic();

  void setPublic(Boolean isPublic);

But everything works when i change variable name to public with setter setPublic and getter getPublic. How do i properly set getter setter for isPublic?

1 Answers

If your variable name is "isPublic", then, your getter should be named isIsPublic.

The "is" shouldn't be in the variable name.

Related