001package top.cenze.utils.enums; 002 003/** 004 * @desc: 生成报表文件类型 005 * @author: chengze 006 * @createByDate: 2023/10/9 9:26 007 */ 008public enum ReportFileTypeEnum { 009 010 PDF(".pdf", "pdf"), 011 XLS(".xls", "Excel97 ~ 2003版本"), 012 XLSX(".xlsx", "Excel2007及之后版本"), 013 HTML(".html", "网页html"), 014 ; 015 016 private String extname; 017 private String desc; 018 ReportFileTypeEnum(String _extName, String _desc) { 019 this.extname = _extName; 020 this.desc = _desc; 021 } 022 023 public String getExtname() { 024 return extname; 025 } 026 027 public String getDesc() { 028 return desc; 029 } 030 031 public static ReportFileTypeEnum getByExtName(String extName) { 032 for (ReportFileTypeEnum e : ReportFileTypeEnum.values()) { 033 if (e.getExtname().equals(extName)) { 034 return e; 035 } 036 } 037 038 return null; 039 } 040}