Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Call method from object in hashmap?

It's late and I'm tired so it is fully possible I'm being retarded but anyways:
I got a HashMap<Object, Object> in which I would like to call a setter method for all the object values in the map. Been trying to figure out a way to do it with replaceAll() but haven't had any success and my googling skills are a bit rusty (as in I've googled but came up empty handed), is this possible or am I being dumb?
Code
map.values().forEach(v -> v.setBlah(someValue));

This should do what you need. If I've understood correctly...
(Oct 12, 2018 05:00 PM)Khamul Wrote:  
Code
map.values().forEach(v -> v.setBlah(someValue));

This should do what you need.  If I've understood correctly...

Precisely, thank you!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by iHDCoolMay 4, 2021 07:51 AM 2 176 May 4, 2021 07:51 AM
Last Post: MavenGradle
[Java] by deadsh0tJan 10, 2019 07:30 AM 2 169 Jan 10, 2019 07:30 AM
Last Post: deadsh0t
[Java] by georgeziozasJan 6, 2018 11:06 AM 2 141 Jan 6, 2018 11:06 AM
Last Post: georgeziozas