import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
/**
* Utility class to convert one object to another.
*
* @author Matt Raible
*/
public final class Util {
/**
* Method to convert a ResourceBundle to a Map object.
* @param rb a given resource bundle
* @return Map a populated map
*/
public static Map convertBundleToMap(ResourceBundle rb) {
Map map = new HashMap();
Enumeration keys = rb.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
map.put(key, rb.getString(key));
}
return map;
}
}