package es.cloudey.pagespeed.util; import java.util.HashMap; import java.util.Map; import android.os.Bundle; import android.os.Parcelable; public class CollectionUtils { public static Bundle toBundle(Map input) { Bundle output = new Bundle(); for(String key : input.keySet()) { output.putParcelable(key, input.get(key)); } return output; } public static Map fromBundle(Bundle input, Class c) { Map output = new HashMap(); for(String key : input.keySet()) { output.put(key, c.cast(input.getParcelable(key))); } return output; } }