ProDisFreEnums.java 800 Bytes
Newer Older
zp's avatar
zp committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
package com.tanpu.fund.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 产品披露频率
 */
public enum ProDisFreEnums {
    Day(1, "天"),
    Week(2, "周"),
    HalfMonth(3, "半月"),
    Month(4, "月"),
    Quarter(5, "季");

    private Integer type;
    private String name;

    ProDisFreEnums(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static Integer Type(String name) {
        ProDisFreEnums[] types = values();
        for (ProDisFreEnums p : types) {
            if (StringUtils.equals(name, p.getName())) {
                return p.getType();
            }
        }
        return null;
    }
}