package com.reyun.dic;

/**
 * Created by nolan on 19/12/2016.
 * description:
 */
public enum ReportDealEnumType {
    SUM("sum", "总和"),
    AVG("avg", "平均值");

    private String code;
    private String name;

    ReportDealEnumType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ReportDealEnumType get(String code) {
        for (ReportDealEnumType reportDealEnumType : ReportDealEnumType.values()) {
            if (reportDealEnumType.getCode().equals(code)) {
                return reportDealEnumType;
            }
        }
        return null;
    }
}
