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

com.soento.core.enums.Profile Maven / Gradle / Ivy

package com.soento.core.enums;

/**
 * @author soento
 */
public enum Profile {
    /**
     * 本地环境
     */
    LOCAL("local"),
    /**
     * 开发环境
     */
    DEV("dev"),
    /**
     * 测试环境
     */
    SIT("sit"),
    /**
     * 验收环境
     */
    UAT("uat"),
    /**
     * 生产环境
     */
    PRO("pro");
    private String value;

    Profile(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static Profile parse(String profile) {
        if (Profile.LOCAL.getValue().equals(profile)) {
            return LOCAL;
        }
        if (Profile.DEV.getValue().equals(profile)) {
            return DEV;
        }
        if (Profile.SIT.getValue().equals(profile)) {
            return SIT;
        }
        if (Profile.UAT.getValue().equals(profile)) {
            return UAT;
        }
        if (Profile.PRO.getValue().equals(profile)) {
            return PRO;
        }
        return PRO;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy