java枚举类型
2016-03-17 17:28
561 查看
package com.idomov.comm.conf; public enum Audit { 全部(0,"全部"),审核通过(1,"审核通过"),审核失败(2,"审核失败"),待审核(3,"待审核"); private final Integer value; private final String ladel; private Audit(Integer value,String ladel) { this.value = value; this.ladel = ladel; } public String getLadel() { return ladel; } public Integer getValue() { return value; } public static Audit valueOf(Integer value) { switch (value) { case 0: return Audit.全部; case 1: return Audit.审核通过; case 2: return Audit.审核失败; case 3: return Audit.待审核; default: throw null; } } public static Audit ladelOf(String ladel) { switch (ladel) { case "全部": return Audit.全部; case "审核通过": return Audit.审核通过; case "审核失败": return Audit.审核失败; case "待审核": return Audit.待审核; default: throw null; } } }
相关文章推荐
- 获取eclipse获取路径
- Java学习笔记(二)
- JSTL c标签和Struts2 s标签常用功能对比
- Spring中RedirectAttributes对象重定向传参
- mysql保存emoji表情问题-java
- spring事务总结
- java基本数据类型转换
- java日志组件介绍(common-logging,log4j,slf4j,logback )+ java日志,需要知道的几件事(commons-logging,log4j,slf4j,logback
- java rmi
- 【笔记】java打包jar之后运行出现中文乱码
- Java正则表达式详解
- 解决SSM,java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener 问题
- Java笔记3→if语句
- java中解析xml时的“伪属性名称”
- MyEclipse打开Jsp报错Failed to create the part's controls
- 一些 Java 格式化输入输出笔记
- SpringMVC学习笔记--(1)
- dubbo,zookeeper和springmvc整合
- java将控制台信息输出到文件
- 40个Java多线程问题总结