All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hildan.fxgson.creators.ObservableMapCreator Maven / Gradle / Ivy

package org.hildan.fxgson.creators;

import java.lang.reflect.Type;

import javafx.collections.FXCollections;
import javafx.collections.ObservableMap;

import com.google.gson.InstanceCreator;

/**
 * An {@link InstanceCreator} for observable maps using {@link FXCollections}.
 */
public class ObservableMapCreator implements InstanceCreator> {

    @Override
    public ObservableMap createInstance(Type type) {
        // No need to use a parametrized map since the actual instance will have the raw type anyway.
        return FXCollections.observableHashMap();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy