Java - Change the value in a HashMap -


i have hashmap this: hashmap<uuid, customclass>.

customclass has lot of properties make meaningfully unique. need able update value of key in map new instance of customclass. need call method called "customclass.clearinfo()" clears/nulls/zeros out values of properties accordingly.

the problem "put" method changes reference of value refer new instance, when call clearinfo(), hashed value cleared.

i need keep values before call clearinfo().

you can remove object using hashmap.remove(key) method. can put new object in key have removed.

see documentation remove().


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -