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

org.openl.rules.webstudio.web.Props Maven / Gradle / Ivy

There is a newer version: 5.27.9
Show newest version
package org.openl.rules.webstudio.web;

import org.springframework.core.env.Environment;

import org.openl.spring.env.DisablePropertySource;
import org.openl.util.StringUtils;

public class Props {
    private static Environment env;

    public static String text(String key) {
        return env.getProperty(key);
    }

    public static boolean bool(String key) {
        return Boolean.parseBoolean(text(key));
    }

    public static Integer integer(String key) {
        String text = text(key);
        return StringUtils.isNotEmpty(text) ? Integer.valueOf(text) : null;
    }

    public static Environment getEnvironment() {
        return env;
    }

    public static void setEnvironment(Environment environment) {
        env = environment;
    }

    public static boolean isDisabled(String name) {
        return Props.bool(DisablePropertySource.PROPS_PREFIX + name);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy