package com.iformall.enums;

/**
 * Created by Stormeye on 2018/08/09.
 */
public enum EnumValidStatus {

    // 1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)

    VALID_RANGE(1, "时间范围"),
    VALID_DAYS(2, "领取后几日有效")
    ;

    public static EnumValidStatus getEnum(Integer code) {
        for (EnumValidStatus value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    private Integer code;
    private String message;

    EnumValidStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
