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

apoc.systemdb.SystemDbConfig Maven / Gradle / Ivy

package apoc.systemdb;

import apoc.systemdb.metadata.ExportMetadata;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class SystemDbConfig {
    public static final String FEATURES_KEY = "features";
    public static final String FILENAME_KEY = "fileName";

    private final List features;
    private final String fileName;

    public SystemDbConfig(Map config) {
        if (config == null) {
            config = Collections.emptyMap();
        }
        List DEFAULT_FEATURES = Stream.of(ExportMetadata.Type.values())
                .map(Enum::name)
                .collect(Collectors.toList());
        this.features = (List) config.getOrDefault(FEATURES_KEY, DEFAULT_FEATURES);
        this.fileName = (String) config.getOrDefault(FILENAME_KEY, "metadata");
    }

    public List getFeatures() {
        return features;
    }

    public String getFileName() {
        return fileName;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy