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

com.riversoft.weixin.common.user.Gender Maven / Gradle / Ivy

There is a newer version: 0.9.8
Show newest version
package com.riversoft.weixin.common.user;

/**
 * Created by exizhai on 10/4/2015.
 */
public enum Gender {

    UNKNOWN(0), MALE(1), FEMALE(2);

    private int code;

    private Gender(int code) {
        this.code = code;
    }

    public static Gender fromCode(int code) {
        for (Gender gender : Gender.values()) {
            if (gender.code == code) {
                return gender;
            }
        }

        return Gender.UNKNOWN;
    }

    public int getCode() {
        return this.code;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy