package com.fdkankan.common.constant;

/**
 * 容量统计方式
 */
public enum SpaceType {

    GB("GB", "按容量"),
    SP("SP", "按个数"),
    ;

    private String code;
    private String message;

    private SpaceType(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String code() {
        return code;
    }

    public String message() {
        return message;
    }

    public static SpaceType get(String code){
        SpaceType[] values = SpaceType.values();
        String enumValue = null;
        for(SpaceType eachValue : values){
            enumValue = eachValue.code();
            if(enumValue.equals(code)){
                return eachValue;
            }
        }
        return null;
    }

}
