All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yuweix.kuafu.permission.enums.EnumGender Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.yuweix.kuafu.permission.enums;




/**
 * @author yuwei
 */
public enum EnumGender {
	MALE((byte) 1, "男"),
	FEMALE((byte) 2, "女");
	
	
	private byte code;
	private String name;
	
	EnumGender(byte code, String name) {
		this.code = code;
		this.name = name;
	}
	
	public byte getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static EnumGender getByCode(byte code) {
		for (EnumGender p: EnumGender.values()) {
			if (p.code == code) {
				return p;
			}
		}
		return null;
	}
	
	public static String getNameByCode(byte code) {
		for (EnumGender p: EnumGender.values()) {
			if (p.code == code) {
				return p.name;
			}
		}
		return "";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy