Add migration of entries

This commit is contained in:
Magnus Ulf Jørgensen 2018-04-14 19:53:40 +02:00
parent f82829c2e3
commit ed6b77cd5c

View File

@ -231,6 +231,24 @@ public class MigratorUtil
return migrated; return migrated;
} }
// Entries are also serialised as list
if (Entry.class.isAssignableFrom(clazz))
{
ParameterizedType parameterizedType = (ParameterizedType) jsonType;
Type keyType = parameterizedType.getActualTypeArguments()[0];
Type valueType = parameterizedType.getActualTypeArguments()[1];
JsonArray array = jsonElement.getAsJsonArray();
JsonElement key = array.get(0);
JsonElement value = array.get(1);
boolean migrated = false;
migrated = migrate(keyType, key) | migrated;
migrated = migrate(valueType, value) | migrated;
return migrated;
}
Type elementType = null; Type elementType = null;
if (clazz.isArray()) if (clazz.isArray())