@@ -0,0 +1,1659 @@
+package cc.rainwave.android.api.types;%0A%0Aimport java.lang.reflect.Type;%0A%0Aimport android.util.Log;%0Aimport cc.rainwave.android.api.JsonHelper;%0A%0Aimport com.google.gson.JsonDeserializationContext;%0Aimport com.google.gson.JsonDeserializer;%0Aimport com.google.gson.JsonElement;%0Aimport com.google.gson.JsonParseException;%0A%0Apublic class SongRating %7B%0A%09private float mUserRating;%0A%09private AlbumRating%5B%5D mUpdatedAlbums;%0A%09%0A%09/** Can't instantiate directly. */%0A%09private SongRating() %7B%7D%0A%09%0A%09public float getUserRating() %7B%0A%09%09return mUserRating;%0A%09%7D%0A%09%0A%09public AlbumRating getDefaultAlbumRating() %7B%0A%09%09return getAlbumRating(0);%0A%09%7D%0A%09%0A%09private AlbumRating getAlbumRating(int i) %7B%0A%09%09return mUpdatedAlbums%5Bi%5D;%0A%09%7D%0A%09%0A%09public static class AlbumRating %7B%0A%09%09private float mUserRating;%0A%09%09%0A%09%09public float getUserRating() %7B%0A%09%09%09return mUserRating;%0A%09%09%7D%0A%09%09%0A%09%09public static class Deserializer implements JsonDeserializer%3CAlbumRating%3E %7B%0A%09%09%09@Override%0A%09%09%09public AlbumRating deserialize(%0A%09%09%09%09final JsonElement element, Type type, JsonDeserializationContext ctx%0A%09%09%09) throws JsonParseException %7B%0A%09%09%09%09final AlbumRating a = new AlbumRating();%0A%09%09%09%09a.mUserRating = JsonHelper.getFloat(element, %22rating_user%22);%0A%09%09%09%09return a;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static class Deserializer implements JsonDeserializer%3CSongRating%3E %7B%0A%09%09@Override%0A%09%09public SongRating deserialize(%0A%09%09%09final JsonElement element, Type type, JsonDeserializationContext ctx%0A%09%09) throws JsonParseException %7B%0A%09%09%09final SongRating a = new SongRating();%0A%09%09%09a.mUserRating = JsonHelper.getFloat(element, %22rating_user%22);%0A%09%09%09a.mUpdatedAlbums = ctx.deserialize(JsonHelper.getJsonArray(element, %22updated_album_ratings%22), AlbumRating%5B%5D.class);%0A%09%09%09return a;%0A%09%09%7D%0A%09%7D%0A%7D%0A

add songrating