public class PlaylistsDeserializer extends java.lang.Object implements com.google.gson.JsonDeserializer<Playlists>
Playlists object.
It happens that the response could contain an object with name "playlist" that is a JSON Array when it has more than one child, but it is a JSON Object when there is only one child.
{
playlist : [
{
//CHILD_ONE
},
{
//CHILD_TWO
},
{
//CHILD_THREE
}
]
}
{
playlist : {
//CHILD_ONE
}
}
| Constructor and Description |
|---|
PlaylistsDeserializer() |
| Modifier and Type | Method and Description |
|---|---|
Playlists |
deserialize(com.google.gson.JsonElement json,
java.lang.reflect.Type typeOfT,
com.google.gson.JsonDeserializationContext context) |
public Playlists deserialize(com.google.gson.JsonElement json, java.lang.reflect.Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
deserialize in interface com.google.gson.JsonDeserializer<Playlists>com.google.gson.JsonParseException