Example usage for com.google.gson.internal.bind MapTypeAdapterFactory MapTypeAdapterFactory

List of usage examples for com.google.gson.internal.bind MapTypeAdapterFactory MapTypeAdapterFactory

Introduction

In this page you can find the example usage for com.google.gson.internal.bind MapTypeAdapterFactory MapTypeAdapterFactory.

Prototype

public MapTypeAdapterFactory(ConstructorConstructor constructorConstructor,
            boolean complexMapKeySerialization) 

Source Link

Usage

From source file:org.eclipse.smarthome.storage.json.PropertiesTypeAdapter.java

License:Open Source License

public PropertiesTypeAdapter(Gson gson) {
    // obtain the default type adapters for String and Object classes
    keyAdapter = gson.getAdapter(String.class);
    valueAdapter = gson.getAdapter(Object.class);

    // obtain default gson objects
    constructor = new ConstructorConstructor(Collections.<Type, InstanceCreator<?>>emptyMap());
    delegate = new MapTypeAdapterFactory(constructor, false).create(new Gson(), TOKEN);
}