private Gson initGson() {
        Type netKeyList = new TypeToken<List<NetworkKey>>() {
        }.getType();
        Type appKeyList = new TypeToken<List<ApplicationKey>>() {
        }.getType();
        Type allocatedUnicastRange = new TypeToken<List<AllocatedUnicastRange>>() {
        }.getType();
        Type allocatedGroupRange = new TypeToken<List<AllocatedGroupRange>>() {
        }.getType();
        Type allocatedSceneRange = new TypeToken<List<AllocatedSceneRange>>() {
        }.getType();
        Type nodeList = new TypeToken<List<ProvisionedMeshNode>>() {
        }.getType();
        Type meshModelList = new TypeToken<List<MeshModel>>() {
        }.getType();
        Type elementList = new TypeToken<List<Element>>() {
        }.getType();
        return new GsonBuilder().registerTypeAdapter(netKeyList, new NetKeyDeserializer())
                .registerTypeAdapter(appKeyList, new AppKeyDeserializer())
                .registerTypeAdapter(allocatedUnicastRange, new AllocatedUnicastRangeDeserializer())
                .registerTypeAdapter(allocatedGroupRange, new AllocatedGroupRangeDeserializer())
                .registerTypeAdapter(allocatedSceneRange, new AllocatedSceneRangeDeserializer())
                .registerTypeAdapter(nodeList, new NodeDeserializer())
                .registerTypeAdapter(elementList, new InternalElementListDeserializer())
                .registerTypeAdapter(meshModelList, new MeshModelListDeserializer())
                .registerTypeAdapter(MeshNetwork.class, new MeshNetworkDeserializer())
                .serializeNulls()
                .setPrettyPrinting()
                .create();
    }
Initializes the Gson based on the network export type.
mesh/src/main/java/no/nordicsemi/android/mesh/ImportExportUtils.java