@Override
    public Element deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context) throws JsonParseException {
        final JsonObject jsonElement = json.getAsJsonObject();
        final int address;
        if (jsonElement.get("elementAddress").isJsonArray()) {
            final JsonArray elementAddress = jsonElement.get("elementAddress").getAsJsonArray();
            if (elementAddress != null) {
                address = MeshParserUtils.unsignedBytesToInt(elementAddress.get(1).getAsByte(), elementAddress.get(0).getAsByte());
                final int location = Integer.parseInt(jsonElement.get("locationDescriptor").getAsString(), 16);
                return new Element(address, location, deserializeModels(context, jsonElement));
            }
        } else {
            address = jsonElement.get("elementAddress").getAsInt();
            final int location = jsonElement.get("locationDescriptor").getAsInt();
            final String name;
            if (jsonElement.has("name")) {
                name = jsonElement.get("name").getAsString();
            } else {
                name = "Element: " + MeshAddress.formatAddress(address, true);
            }
            return new Element(address, location, deserializeModels(context, jsonElement), name);
        }
        return null;
    }
Class for de-serializing a list of elements stored in the Mesh Configuration Database
mesh/src/main/java/no/nordicsemi/android/mesh/transport/ElementDbMigrator.java