cn.hutool.setting.profile.GlobalProfile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hutool-all Show documentation
Show all versions of hutool-all Show documentation
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
package cn.hutool.setting.profile;
import cn.hutool.core.lang.Singleton;
import cn.hutool.setting.Setting;
/**
* 全局的Profile配置中心
*
* @author Looly
*
*/
public class GlobalProfile {
private GlobalProfile() {
}
// -------------------------------------------------------------------------------- Static method start
/**
* 设置全局环境
* @param profile 环境
* @return {@link Profile}
*/
public static Profile setProfile(String profile) {
return Singleton.get(Profile.class, profile);
}
/**
* 获得全局的当前环境下对应的配置文件
* @param settingName 配置文件名,可以忽略默认后者(.setting)
* @return {@link Setting}
*/
public static Setting getSetting(String settingName) {
return Singleton.get(Profile.class).getSetting(settingName);
}
// -------------------------------------------------------------------------------- Static method end
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy