1,类的创建
package org.springblade.statistical.enums;import lombok.AllArgsConstructor;
import lombok.Getter;/*** 病毒类型.*/
@Getter
@AllArgsConstructor
public enum VirusTypeEnum {/*** 流感病毒.*/FLU("flu", "流感病毒"),/*** 腺病毒.*/HADV("hadv", "腺病毒"),/*** 人偏肺病毒.*/HMPV("hmpv", "人偏肺病毒"),/*** 人副流感病毒.*/HPIV("hpiv", "人副流感病毒"),/*** 宏基因组.*/METAV("metav", "宏基因组"),/*** 呼吸道合胞.*/RSV("rsv", "呼吸道合胞");private final String virusType;private final String description;
}
2,使用示例
public String getType() {return VirusTypeEnum.FLU.getVirusType();
}