package com.lesingle.edu.common.enums;

import lombok.Getter;

/**
 * Gender Enum
 */
@Getter
public enum Gender {

    MALE("male", "Male"),
    FEMALE("female", "Female");

    private final String code;
    private final String description;

    Gender(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static Gender fromCode(String code) {
        for (Gender gender : values()) {
            if (gender.getCode().equals(code)) {
                return gender;
            }
        }
        return null;
    }

}
