package com.sikey.wa04.common.enums;

import lombok.Getter;

/**
 * 性别枚举
 */
@Getter
public enum Gender {
    /**
     * 未设置
     */
    UNKNOWN(0),
    /**
     * 男孩
     */
    BOY(2),
    /**
     * 女孩
     */
    GIRL(3);

    private final int value;

    Gender(int value) {
        this.value = value;
    }

    public static Gender valueOf(Integer g) {
        Gender[] genders = Gender.values();
        for (Gender gender : genders) {
            if (gender.getValue() == g) {
                return gender;
            }
        }
        return null;
    }
}
