in stetho/src/main/java/com/facebook/stetho/inspector/protocol/module/DOMStorage.java [147:167]
private static void assignByType(
SharedPreferences.Editor editor,
String key,
Object value)
throws IllegalArgumentException {
if (value instanceof Integer) {
editor.putInt(key, (Integer)value);
} else if (value instanceof Long) {
editor.putLong(key, (Long)value);
} else if (value instanceof Float) {
editor.putFloat(key, (Float)value);
} else if (value instanceof Boolean) {
editor.putBoolean(key, (Boolean)value);
} else if (value instanceof String) {
editor.putString(key, (String)value);
} else if (value instanceof Set) {
editor.putStringSet(key, (Set<String>)value);
} else {
throw new IllegalArgumentException("Unsupported type=" + value.getClass().getName());
}
}