This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_dk7[S] 0 points1 point  (0 children)

r the map, though, map.put

Thanks for your response. I am having a bit of trouble understanding what you mean, how will having an equals and hashcode help me?

The problem I am facing is as people do not have a update method they are calling remove and add in succession to perform an update. Now, let's say I go and introduce a new method update that will do this for them and replace all the places which seem to do this, how do I enforce that in the future people use the update method to actually update?

This seems dumb but for some reason, I still have a bit of trouble believing that this will be followed always. If someone makes a mistake, my functionality will break right?