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