Enum Class AuthUserGender

java.lang.Object
java.lang.Enum<AuthUserGender>
me.zhyd.oauth.enums.AuthUserGender
All Implemented Interfaces:
Serializable, Comparable<AuthUserGender>, Constable

public enum AuthUserGender extends Enum<AuthUserGender>
用户性别
Since:
1.8
Author:
yadong.zhang (yadong.zhang0415(a)gmail.com)
  • Enum Constant Details

    • MALE

      public static final AuthUserGender MALE
      MALE/FAMALE为正常值,通过getRealGender(String)方法获取真实的性别 UNKNOWN为容错值,部分平台不会返回用户性别,为了方便统一,使用UNKNOWN标记所有未知或不可测的用户性别信息
    • FEMALE

      public static final AuthUserGender FEMALE
    • UNKNOWN

      public static final AuthUserGender UNKNOWN
  • Method Details

    • values

      public static AuthUserGender[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AuthUserGender valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getRealGender

      public static AuthUserGender getRealGender(String originalGender)
      获取用户的实际性别,常规网站
      Parameters:
      originalGender - 用户第三方标注的原始性别
      Returns:
      用户性别
    • getWechatRealGender

      public static AuthUserGender getWechatRealGender(String originalGender)
      获取微信平台用户的实际性别,0表示未定义,1表示男性,2表示女性
      Parameters:
      originalGender - 用户第三方标注的原始性别
      Returns:
      用户性别
      Since:
      1.13.2