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