org.solovyev.android.prefs
Class CollectionToStringPreference<C extends Collection<T>,T>

java.lang.Object
  extended by org.solovyev.android.prefs.AbstractPreference<C>
      extended by org.solovyev.android.prefs.CollectionToStringPreference<C,T>
All Implemented Interfaces:
Preference<C>

public class CollectionToStringPreference<C extends Collection<T>,T>
extends AbstractPreference<C>


Method Summary
static
<T> CollectionToStringPreference<List<T>,T>
forList(String key, List<T> defaultValue, org.solovyev.common.text.Mapper<List<T>> mapper)
           
static CollectionToStringPreference<List<String>,String> forStringList(String key, List<String> defaultValue)
           
static
<T> CollectionToStringPreference<List<T>,T>
forTypedList(String key, List<T> defaultValue, org.solovyev.common.text.Mapper<T> mapper)
           
protected  C getPersistedValue(android.content.SharedPreferences preferences)
           
protected  void putPersistedValue(android.content.SharedPreferences.Editor editor, C values)
          Method saved preference to preferences container editor
 
Methods inherited from class org.solovyev.android.prefs.AbstractPreference
getDefaultValue, getKey, getPreference, getPreferenceNoError, isSameKey, isSet, putDefault, putPreference, tryPutDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forList

@Nonnull
public static <T> CollectionToStringPreference<List<T>,T> forList(@Nonnull
                                                                          String key,
                                                                          @Nullable
                                                                          List<T> defaultValue,
                                                                          @Nonnull
                                                                          org.solovyev.common.text.Mapper<List<T>> mapper)

forTypedList

@Nonnull
public static <T> CollectionToStringPreference<List<T>,T> forTypedList(@Nonnull
                                                                               String key,
                                                                               @Nullable
                                                                               List<T> defaultValue,
                                                                               @Nonnull
                                                                               org.solovyev.common.text.Mapper<T> mapper)

forStringList

@Nonnull
public static CollectionToStringPreference<List<String>,String> forStringList(@Nonnull
                                                                                      String key,
                                                                                      @Nullable
                                                                                      List<String> defaultValue)

getPersistedValue

protected C getPersistedValue(@Nonnull
                              android.content.SharedPreferences preferences)
Specified by:
getPersistedValue in class AbstractPreference<C extends Collection<T>>
Parameters:
preferences - preferences container
Returns:
preference value from preferences with key defined by AbstractPreference.getKey() method

putPersistedValue

protected void putPersistedValue(@Nonnull
                                 android.content.SharedPreferences.Editor editor,
                                 @Nonnull
                                 C values)
Description copied from class: AbstractPreference
Method saved preference to preferences container editor

Specified by:
putPersistedValue in class AbstractPreference<C extends Collection<T>>
Parameters:
editor - editor in which value must be saved
values - value to be saved


Copyright © 2014 se.solovyev. All Rights Reserved.