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

org.iartisan.runtime.env.EnvContextConfig Maven / Gradle / Ivy

The newest version!
package org.iartisan.runtime.env;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class EnvContextConfig {

    private static Map configHolder = new ConcurrentHashMap();

    public static String get(String key){
        return configHolder.get(key);
    }
    public static String get(String key,Object defaultVal){
        if(!configHolder.containsKey(key)){
            return ""+defaultVal;
        }
        return configHolder.get(key);
    }

    public static void put(String key,String val){
        if(val!=null){
            val = val.trim();
        }
        configHolder.put(key,val);
    }
    public static String remove(String key){
        return configHolder.remove(key);
    }

    public static String getAppName(){
        return get("app.name");
    }
    public static String getAppEnv(){
        return get("env");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy