| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package com.xjrsoft.common.enums;
- public enum GenderIntEnum {
- /**
- * 男
- */
- MALE("SB10001", 1),
- /**
- * 女
- */
- FEMALE("SB10002", 2);
- final String code;
- final Integer value;
- public String getCode() {
- return this.code;
- }
- public Integer getValue() {
- return this.value;
- }
- public static Integer getValue(String code) {
- for (GenderIntEnum item : values()) {
- if (item.getCode().equals(code)) {
- return item.getValue();
- }
- }
- return null;
- }
- GenderIntEnum(final String code, final Integer message) {
- this.code = code;
- this.value = message;
- }
- public static String getCode(Integer value) {
- for (GenderIntEnum item : values()) {
- if (item.getValue() == value) {
- return item.getCode();
- }
- }
- return null;
- }
- }
|