Using Java 8:
map.replaceAll((k, v) -> v - 20);
Using Java 7 or older:
You can iterate over the entries and update the values as follows:
for (Map.Entry<Key, Long> entry : playerCooldowns.entrySet()) {
entry.setValue(entry.getValue() - 20);
}
Using Java 8:
map.replaceAll((k, v) -> v - 20);
Using Java 7 or older:
You can iterate over the entries and update the values as follows:
for (Map.Entry<Key, Long> entry : playerCooldowns.entrySet()) {
entry.setValue(entry.getValue() - 20);
}