Created
January 13, 2013 18:36
-
-
Save alexchiri/4525592 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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