// Path: src/main/java/net/ilexiconn/magister/container/SingleStudyGuide.java
// public class SingleStudyGuide implements Serializable {
//     @SerializedName("Id")
//     public int id;
// 
//     @SerializedName("Links")
//     public Link[] links;
// 
//     @SerializedName("Van")
//     public String from;
// 
//     @SerializedName("TotEnMet")
//     public String to;
// 
//     @SerializedName("Titel")
//     public String title;
// 
//     @SerializedName("IsZichtbaar")
//     public boolean isVisible;
// 
//     @SerializedName("InLeerlingArchief")
//     public boolean isArchived;
// 
//     @SerializedName("VakCodes")
//     public String[] courses;
// 
//     public StudyGuideItem[] items;
// }
// 
// Path: src/main/java/net/ilexiconn/magister/container/StudyGuideItem.java
// public class StudyGuideItem implements Serializable {
//     // Bronnen
// 
//     @SerializedName("Id")
//     public int id;
// 
//     @SerializedName("Links")
//     public Link[] links;
// 
//     @SerializedName("Van")
//     public String from;
// 
//     @SerializedName("TotEnMet")
//     public String to;
// 
//     @SerializedName("Titel")
//     public String title;
// 
//     @SerializedName("Omschrijving")
//     public String description;
// 
//     @SerializedName("IsZichtbaar")
//     public boolean isVisible;
// 
//     @SerializedName("Kleur")
//     public int color;
// 
//     @SerializedName("Volgnummer")
//     public int followId;
// }
// 
// Path: src/main/java/net/ilexiconn/magister/util/GsonUtil.java
// public class GsonUtil {
//     private static Gson gson = new Gson();
//     private static JsonParser parser = new JsonParser();
// 
//     public static Gson getGson() {
//         return gson;
//     }
// 
//     public static JsonElement getFromJson(String json, String key) {
//         return parser.parse(json).getAsJsonObject().get(key);
//     }
// 
//     public static Gson getGsonWithAdapter(Class<?> type, TypeAdapter<?> adapter) {
//         Map<Class<?>, TypeAdapter<?>> map = new HashMap<Class<?>, TypeAdapter<?>>();
//         map.put(type, adapter);
//         return getGsonWithAdapters(map);
//     }
// 
//     public static Gson getGsonWithAdapters(Map<Class<?>, TypeAdapter<?>> map) {
//         GsonBuilder builder = new GsonBuilder();
//         for (Map.Entry<Class<?>, TypeAdapter<?>> entry : map.entrySet()) {
//             builder.registerTypeAdapter(entry.getKey(), entry.getValue());
//         }
//         return builder.create();
//     }
// }


import net.ilexiconn.magister.util.GsonUtil;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.*;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import net.ilexiconn.magister.container.SingleStudyGuide;
import net.ilexiconn.magister.container.StudyGuideItem;
/*
 * Copyright (c) 2015 iLexiconn
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

package net.ilexiconn.magister.adapter;



public class SingleStudyGuideAdapter extends TypeAdapter<SingleStudyGuide> {
    public Gson gson = GsonUtil.getGson();

    @Override
    public void write(JsonWriter out, SingleStudyGuide value) throws IOException {
        throw new UnsupportedOperationException("Not implemented");
    }

    @Override
    public SingleStudyGuide read(JsonReader in) throws IOException {
        JsonObject object = gson.getAdapter(JsonElement.class).read(in).getAsJsonObject();
        SingleStudyGuide studyGuide = gson.fromJson(object, SingleStudyGuide.class);
        JsonArray array = object.get("Onderdelen").getAsJsonObject().get("Items").getAsJsonArray();
// Path: src/main/java/net/ilexiconn/magister/container/SingleStudyGuide.java
// public class SingleStudyGuide implements Serializable {
//     @SerializedName("Id")
//     public int id;
// 
//     @SerializedName("Links")
//     public Link[] links;
// 
//     @SerializedName("Van")
//     public String from;
// 
//     @SerializedName("TotEnMet")
//     public String to;
// 
//     @SerializedName("Titel")
//     public String title;
// 
//     @SerializedName("IsZichtbaar")
//     public boolean isVisible;
// 
//     @SerializedName("InLeerlingArchief")
//     public boolean isArchived;
// 
//     @SerializedName("VakCodes")
//     public String[] courses;
// 
//     public StudyGuideItem[] items;
// }
// 
// Path: src/main/java/net/ilexiconn/magister/container/StudyGuideItem.java
// public class StudyGuideItem implements Serializable {
//     // Bronnen
// 
//     @SerializedName("Id")
//     public int id;
// 
//     @SerializedName("Links")
//     public Link[] links;
// 
//     @SerializedName("Van")
//     public String from;
// 
//     @SerializedName("TotEnMet")
//     public String to;
// 
//     @SerializedName("Titel")
//     public String title;
// 
//     @SerializedName("Omschrijving")
//     public String description;
// 
//     @SerializedName("IsZichtbaar")
//     public boolean isVisible;
// 
//     @SerializedName("Kleur")
//     public int color;
// 
//     @SerializedName("Volgnummer")
//     public int followId;
// }
// 
// Path: src/main/java/net/ilexiconn/magister/util/GsonUtil.java
// public class GsonUtil {
//     private static Gson gson = new Gson();
//     private static JsonParser parser = new JsonParser();
// 
//     public static Gson getGson() {
//         return gson;
//     }
// 
//     public static JsonElement getFromJson(String json, String key) {
//         return parser.parse(json).getAsJsonObject().get(key);
//     }
// 
//     public static Gson getGsonWithAdapter(Class<?> type, TypeAdapter<?> adapter) {
//         Map<Class<?>, TypeAdapter<?>> map = new HashMap<Class<?>, TypeAdapter<?>>();
//         map.put(type, adapter);
//         return getGsonWithAdapters(map);
//     }
// 
//     public static Gson getGsonWithAdapters(Map<Class<?>, TypeAdapter<?>> map) {
//         GsonBuilder builder = new GsonBuilder();
//         for (Map.Entry<Class<?>, TypeAdapter<?>> entry : map.entrySet()) {
//             builder.registerTypeAdapter(entry.getKey(), entry.getValue());
//         }
//         return builder.create();
//     }
// }


// Path: src/main/java/net/ilexiconn/magister/adapter/SingleStudyGuideAdapter.java
import net.ilexiconn.magister.util.GsonUtil;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.*;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import net.ilexiconn.magister.container.SingleStudyGuide;
import net.ilexiconn.magister.container.StudyGuideItem;

/*
 * Copyright (c) 2015 iLexiconn
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

package net.ilexiconn.magister.adapter;



public class SingleStudyGuideAdapter extends TypeAdapter<SingleStudyGuide> {
    public Gson gson = GsonUtil.getGson();

    @Override
    public void write(JsonWriter out, SingleStudyGuide value) throws IOException {
        throw new UnsupportedOperationException("Not implemented");
    }

    @Override
    public SingleStudyGuide read(JsonReader in) throws IOException {
        JsonObject object = gson.getAdapter(JsonElement.class).read(in).getAsJsonObject();
        SingleStudyGuide studyGuide = gson.fromJson(object, SingleStudyGuide.class);
        JsonArray array = object.get("Onderdelen").getAsJsonObject().get("Items").getAsJsonArray();
        List<StudyGuideItem> studyGuideItemList = new ArrayList<StudyGuideItem>();