separating application

This commit is contained in:
Sergey Solovyev
2012-01-03 01:52:15 +04:00
parent c816772d04
commit 6f2040eb78
20 changed files with 873 additions and 709 deletions

View File

@@ -37,6 +37,11 @@ public class StringPreference<T> extends AbstractPreference<T> {
return new StringPreference<T>(id, parser.parseValue(defaultValue), parser);
}
@NotNull
public static <T extends Enum> StringPreference<T> newInstance(@NotNull String id, @Nullable T defaultValue, @NotNull Class<T> enumType) {
return new StringPreference<T>(id, defaultValue, new EnumMapper<T>(enumType));
}
@Override
protected T getPersistedValue(@NotNull SharedPreferences preferences) {
return mapper.parseValue(preferences.getString(getKey(), null));