package com.shenmazong.shenmablogserver.enums;
public enum ShareStatusEnum {
PRIVATE(0, "私密"),
SHARE(1, "分享"),
;
// 成员
private Integer code;
private String name;
// 构造方法
private ShareStatusEnum(int code, String name) {
this.name = name;
this.code = code;
}
// 普通方法
public static String getName(int code) {
for (ShareStatusEnum c : ShareStatusEnum.values()) {
if (c.getCode() == code) {
return c.name;
}
}
return null;
}
// get set 方法
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}