最近项目中需要根据前端参数返回相对应的枚举,此时需要遍历,在此记录一下。
/**
* @author:zhangzhixiang
* @date:2019/03/19 20:44:23
* @description:跟进对象数量限制
*/
public enum FollowUpObjectNumEnum {
/**
* 单位
*/
INSTITUTION(1, "单位", 10),
/**
* 客户
*/
CUSTOMER(2, "客户", 5);
FollowUpObjectNumEnum(int code, String desc, int num) {
this.code = code;
this.desc = desc;
this.num = num;
}
private int code;
private String desc;
private int num;
public int getCode() {return code;}
public void setCode() {this.code = code;}
public String getDesc() {return desc;}
public void setDesc() {this.desc = desc;}
public int getNum() {return num;}
public void se