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