com.dahuatech.icc.brm.enums.SexEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-brm Show documentation
Show all versions of java-sdk-brm Show documentation
Dahua ICC Open API SDK for Java
/*
*
* *********************** 版权声明 ***********************************
*
* 版权所有:浙江大华技术股份有限公司
* ©CopyRight DahuaTech 2019
*
* *********************************************************************
*
*/
package com.dahuatech.icc.brm.enums;
import java.util.ArrayList;
import java.util.List;
/**
* 性别
*
*/
public enum SexEnum {
UNKNOWN(0,"未知"),
MAN(1,"男"),
FEMALE(2,"女");
private Integer id;
private String name;
private SexEnum(Integer id, String name) {
this.id = id;
this.name = name;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public static SexEnum forValue(String name){
for(SexEnum sex : values()){
if(sex.getName().equals(name)){
return sex;
}
}
return null;
}
public static SexEnum forValue(Integer id){
for(SexEnum sex : values()){
if(sex.getId().equals(id)){
return sex;
}
}
return null;
}
public static List getSexNames(){
List types = new ArrayList<>();
for (SexEnum typeEnum : SexEnum.values()) {
types.add(typeEnum.getName());
}
return types;
}
}