Exemplo n.º 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);
   }
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 private String getSharedPreferenceKey(ParameterKey parameterKey) {
   return this.mPrefix + "-" + parameterKey.name();
 }