// Path: ADNLibModule/src/main/java/com/alwaysallthetime/adnlib/data/IPageableAppDotNetObject.java
// public interface IPageableAppDotNetObject extends IAppDotNetObject {
//     public String getPaginationId();
// }
// 
// Path: ADNLibModule/src/main/java/com/alwaysallthetime/adnlib/gson/AppDotNetGson.java
// public class AppDotNetGson {
//     static Gson adapterSafeInstance;
// 
//     private static Gson instance;
//     private static Gson persistenceInstance;
// 
//     static {
//         final GsonBuilder builder = new GsonBuilder()
//                 .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//                 .registerTypeAdapter(Date.class, new Iso8601DateTypeAdapter());
// 
//         persistenceInstance = builder.create();
// 
//         adapterSafeInstance = builder
//                 .addSerializationExclusionStrategy(new IncludeFieldsByDefaultSerializationExclusionStrategy())
//                 .create();
// 
//         instance = builder
//                 .registerTypeHierarchyAdapter(Annotatable.class, new AnnotatableSerializer())
//                 .registerTypeAdapter(Count.class, new CountDeserializer())
//                 .create();
//     }
// 
//     /**
//      * A Gson instance for serializing to and deserializing from the App.net API.
//      *
//      * Fields that shouldn't be sent to the API are excluded from serialization, e.g. createdAt.
//      *
//      * @return a Gson instance
//      */
//     public static Gson getInstance() {
//         return instance;
//     }
// 
//     /**
//      * A Gson instance suitable for disk persistence, in that it will serialize and deserialize all fields.
//      *
//      * @return a Gson instance
//      */
//     public static Gson getPersistenceInstance() {
//         return persistenceInstance;
//     }
// 
//     /**
//      * A Gson instance without certain customer adapters. This allows those adapters to get the "default" serialization
//      * before modifying it.
//      *
//      * @return a Gson instance
//      */
//     static Gson getAdapterSafeInstance() {
//         return adapterSafeInstance;
//     }
// 
//     private static <T extends IAppDotNetObject> T copy(IAppDotNetObject object, Gson gson) {
//         final JsonElement json = gson.toJsonTree(object);
//         return (T) gson.fromJson(json, object.getClass());
//     }
// 
//     public static <T extends IAppDotNetObject> T copy(IAppDotNetObject object) {
//         return copy(object, persistenceInstance);
//     }
// 
//     public static <T extends IAppDotNetObject> T copyForWriting(IAppDotNetObject object) {
//         return copy(object, instance);
//     }
// }


import android.content.SharedPreferences;
import com.alwaysallthetime.adnlib.data.IPageableAppDotNetObject;
import com.alwaysallthetime.adnlib.gson.AppDotNetGson;
import com.google.gson.Gson;
import java.util.ArrayList;
package com.alwaysallthetime.adnlib.resourceStream;




public class ResourceStreamSerializer {
    public static void serialize(SharedPreferences preferences, String key, ResourceStream resourceStream) {
        String resourceStreamJson = AppDotNetGson.getInstance().toJson(resourceStream);
        String objectsJson = AppDotNetGson.getPersistenceInstance().toJson(resourceStream.getObjects());
        SharedPreferences.Editor edit = preferences.edit();
        edit.putString(key, resourceStreamJson);
        edit.putString(key + "_objects", objectsJson);
        edit.commit();
    }

    public static void remove(SharedPreferences preferences, String key) {
        SharedPreferences.Editor edit = preferences.edit();
        edit.remove(key);
// Path: ADNLibModule/src/main/java/com/alwaysallthetime/adnlib/data/IPageableAppDotNetObject.java
// public interface IPageableAppDotNetObject extends IAppDotNetObject {
//     public String getPaginationId();
// }
// 
// Path: ADNLibModule/src/main/java/com/alwaysallthetime/adnlib/gson/AppDotNetGson.java
// public class AppDotNetGson {
//     static Gson adapterSafeInstance;
// 
//     private static Gson instance;
//     private static Gson persistenceInstance;
// 
//     static {
//         final GsonBuilder builder = new GsonBuilder()
//                 .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//                 .registerTypeAdapter(Date.class, new Iso8601DateTypeAdapter());
// 
//         persistenceInstance = builder.create();
// 
//         adapterSafeInstance = builder
//                 .addSerializationExclusionStrategy(new IncludeFieldsByDefaultSerializationExclusionStrategy())
//                 .create();
// 
//         instance = builder
//                 .registerTypeHierarchyAdapter(Annotatable.class, new AnnotatableSerializer())
//                 .registerTypeAdapter(Count.class, new CountDeserializer())
//                 .create();
//     }
// 
//     /**
//      * A Gson instance for serializing to and deserializing from the App.net API.
//      *
//      * Fields that shouldn't be sent to the API are excluded from serialization, e.g. createdAt.
//      *
//      * @return a Gson instance
//      */
//     public static Gson getInstance() {
//         return instance;
//     }
// 
//     /**
//      * A Gson instance suitable for disk persistence, in that it will serialize and deserialize all fields.
//      *
//      * @return a Gson instance
//      */
//     public static Gson getPersistenceInstance() {
//         return persistenceInstance;
//     }
// 
//     /**
//      * A Gson instance without certain customer adapters. This allows those adapters to get the "default" serialization
//      * before modifying it.
//      *
//      * @return a Gson instance
//      */
//     static Gson getAdapterSafeInstance() {
//         return adapterSafeInstance;
//     }
// 
//     private static <T extends IAppDotNetObject> T copy(IAppDotNetObject object, Gson gson) {
//         final JsonElement json = gson.toJsonTree(object);
//         return (T) gson.fromJson(json, object.getClass());
//     }
// 
//     public static <T extends IAppDotNetObject> T copy(IAppDotNetObject object) {
//         return copy(object, persistenceInstance);
//     }
// 
//     public static <T extends IAppDotNetObject> T copyForWriting(IAppDotNetObject object) {
//         return copy(object, instance);
//     }
// }


// Path: ADNLibModule/src/main/java/com/alwaysallthetime/adnlib/resourceStream/ResourceStreamSerializer.java
import android.content.SharedPreferences;
import com.alwaysallthetime.adnlib.data.IPageableAppDotNetObject;
import com.alwaysallthetime.adnlib.gson.AppDotNetGson;
import com.google.gson.Gson;
import java.util.ArrayList;

package com.alwaysallthetime.adnlib.resourceStream;




public class ResourceStreamSerializer {
    public static void serialize(SharedPreferences preferences, String key, ResourceStream resourceStream) {
        String resourceStreamJson = AppDotNetGson.getInstance().toJson(resourceStream);
        String objectsJson = AppDotNetGson.getPersistenceInstance().toJson(resourceStream.getObjects());
        SharedPreferences.Editor edit = preferences.edit();
        edit.putString(key, resourceStreamJson);
        edit.putString(key + "_objects", objectsJson);
        edit.commit();
    }

    public static void remove(SharedPreferences preferences, String key) {
        SharedPreferences.Editor edit = preferences.edit();
        edit.remove(key);
        edit.remove(key + "_objects");