Currently there are a set of methods on some of our domain objects that we would like to *not* be in the public interface and only be callable by the members of the package. For instance: com.redhat.rhn.domain.user.User.setRoles() com.redhat.rhn.domain.org.Org.getUserGroups() com.redhat.rhn.domain.org.Org.setUserGroups() we don't really want public consumers of these classes being able to call these methods, but since all methods in an interface are public we are stuck.
Maybe we can have two (2) interfaces. One which is package protected the other being public. So all non-public methods should be in the package protected interface. public interface User { long getId(); void setId(long id); ... } interface UserProtected { void setRoles(List roles); ... } Then UserImpl can implement both. Only members of com.redhat.rhn.domain.user can access UserProtected, while others can only use User.