Skip to content

Instantly share code, notes, and snippets.

@alexchiri
Created January 13, 2013 18:36
Show Gist options
  • Save alexchiri/4525592 to your computer and use it in GitHub Desktop.
Save alexchiri/4525592 to your computer and use it in GitHub Desktop.
package com.alexchiri.bank;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
* Alexandru Chiritescu
* 13-1-13
*/
public class Safe extends ConcurrentHashMap<String, MoneyBag> {
public Safe(List<MoneyBag> moneyBags) {
if(moneyBags != null && moneyBags.size() > 0) {
System.out.println("Loading safe with " + moneyBags.size() + " money bags!");
for(MoneyBag money:moneyBags) {
put(UUID.randomUUID().toString(), money);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment