package com.zcxk.enums;

/**
* @Author lihui
* @Description 场景类型
* @Date 16:59 2021/5/17
* @Param
* @return
**/
public enum SceneEnum {

    SOURCE_WATER(1, "水源"),

    WATER_WORKS(2, "水厂"),

    PUMPING_STATION(3, "泵站"),

    PIPE_NETWORK(4, "管网")

    ;

    private int type;

    private String msg;

    SceneEnum(int type, String msg){
        this.type = type;
        this.msg = msg;
    }

    public static SceneEnum getSceneEnum(int type){
        SceneEnum[] sceneEnums = SceneEnum.values();
        for (SceneEnum sceneEnum: sceneEnums) {
            if (sceneEnum.type == type) {
                return sceneEnum;
            }
        }
        return null;
    }

    public static String getMsg(int type){
        SceneEnum sceneEnum =  getSceneEnum(type);
        return sceneEnum == null ? "" : sceneEnum.msg;
    }

}
