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

ru.curs.celesta.AppSettings Maven / Gradle / Ivy

There is a newer version: 8.1.0
Show newest version
package ru.curs.celesta;

import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Properties;
import java.util.Set;

/**
 * Application settings.
 */
public final class AppSettings extends BaseAppSettings {

    private final Set celestaScan;

    public AppSettings(Properties properties) {
        super(properties);
        this.celestaScan = extractCelestaScanFromProperties(properties);
    }

    public static Set extractCelestaScanFromProperties(Properties properties) {
        final String celestaScanProperty = properties.getProperty("celestaScan");
        final Set celestaScanVar = new LinkedHashSet<>();

        if (celestaScanProperty != null) {
            Arrays.stream(celestaScanProperty.split(","))
                    .map(String::trim)
                    .forEach(celestaScanVar::add);
        }

        return Collections.unmodifiableSet(celestaScanVar);
    }

    public Set getCelestaScan() {
        return this.celestaScan;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy