Пример #1
0
 private void readStringMapToLoad(Map<String, String> map) {
   for (ParameterKey parameterKey : this.mParameters.keys()) {
     String string;
     ParameterHolder parameterHolder = this.mParameters.get(parameterKey);
     if (!parameterKey.isPersistent()
         || !this.isSelectable(parameterHolder)
         || (string = map.get(parameterKey.name())) == null) continue;
     parameterHolder.deserialize(string);
   }
 }
Пример #2
0
 private Map<String, String> getStringMapToWriteInSP() {
   HashMap<String, String> hashMap = new HashMap<String, String>();
   for (ParameterKey parameterKey : this.mParameters.keys()) {
     Object object = this.mParameters.get(parameterKey);
     if (!parameterKey.isPersistent()
         || !this.isSelectable(object)
         || (object = object.serialize()) == null) continue;
     hashMap.put(this.getSharedPreferenceKey(parameterKey), (String) object);
   }
   return hashMap;
 }
Пример #3
0
 public final void restore(
     ParamSharedPrefWrapper paramSharedPrefWrapper, ParameterKey[] arrparameterKey) {
   HashMap<String, String> hashMap = new HashMap<String, String>();
   for (ParameterKey parameterKey : arrparameterKey) {
     String string;
     if (!parameterKey.isPersistent()
         || (string =
                 paramSharedPrefWrapper.getParamFromSP(
                     this.getSharedPreferenceKey(parameterKey), null))
             == null) continue;
     hashMap.put(parameterKey.name(), string);
   }
   this.readStringMapToLoad(hashMap);
 }
Пример #4
0
 private String getSharedPreferenceKey(ParameterKey parameterKey) {
   return this.mPrefix + "-" + parameterKey.name();
 }