@Override
    public Collection<KeyTransaction> deserialize(JsonElement element, Type type, JsonDeserializationContext context)
        throws JsonParseException
    {
        JsonObject obj = element.getAsJsonObject();
        JsonArray kts = obj.getAsJsonArray("key_transactions");
        List<KeyTransaction> values = new ArrayList<KeyTransaction>();
        if(kts != null && kts.isJsonArray())
        {
            for(JsonElement kt : kts)
                values.add(gson.fromJson(kt, KeyTransaction.class));
        }
        return values;
    }
@ Override public Collection < KeyTransaction > deserialize ( JsonElement element , Type type , JsonDeserializationContext context ) throws JsonParseException { JsonObject obj = element . getAsJsonObject ( ) ; JsonArray kts = obj . getAsJsonArray ( "key_transactions" ) ; List < KeyTransaction > values = new ArrayList < KeyTransaction > ( ) ; if ( kts != null && kts . isJsonArray ( ) ) { for ( JsonElement kt : kts ) values . add ( gson . fromJson ( kt , KeyTransaction . class ) ) ; } return values ; }
Gson invokes this call-back method during deserialization when it encounters a field of the specified type.
@param element The Json data being deserialized
@param type The type of the Object to deserialize to
@param context The JSON deserialization context
@return The key transactions