// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;

import us.hebi.quickbuf.ProtoEnum;
import us.hebi.quickbuf.ProtoUtil;

public final class GenderOuterClass {
  /**
   * Protobuf enum {@code Gender}
   */
  public enum Gender implements ProtoEnum<Gender> {
    /**
     * <code>GenderNone = 0;</code>
     */
    GenderNone("GenderNone", 0),

    /**
     * <code>GenderMan = 1;</code>
     */
    GenderMan("GenderMan", 1),

    /**
     * <code>GenderWoman = 2;</code>
     */
    GenderWoman("GenderWoman", 2);

    /**
     * <code>GenderNone = 0;</code>
     */
    public static final int GenderNone_VALUE = 0;

    /**
     * <code>GenderMan = 1;</code>
     */
    public static final int GenderMan_VALUE = 1;

    /**
     * <code>GenderWoman = 2;</code>
     */
    public static final int GenderWoman_VALUE = 2;

    private final String name;

    private final int number;

    private Gender(String name, int number) {
      this.name = name;
      this.number = number;
    }

    /**
     * @return the string representation of enum entry
     */
    @Override
    public String getName() {
      return name;
    }

    /**
     * @return the numeric wire value of this enum entry
     */
    @Override
    public int getNumber() {
      return number;
    }

    /**
     * @return a converter that maps between this enum's numeric and text representations
     */
    public static ProtoEnum.EnumConverter<Gender> converter() {
      return GenderConverter.INSTANCE;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value, or null if unknown.
     */
    public static Gender forNumber(int value) {
      return GenderConverter.INSTANCE.forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @param other Fallback value in case the value is not known.
     * @return The enum associated with the given numeric wire value, or the fallback value if unknown.
     */
    public static Gender forNumberOr(int number, Gender other) {
      Gender value = forNumber(number);
      return value == null ? other : value;
    }

    enum GenderConverter implements ProtoEnum.EnumConverter<Gender> {
      INSTANCE;

      private static final Gender[] lookup = new Gender[3];

      static {
        lookup[0] = GenderNone;
        lookup[1] = GenderMan;
        lookup[2] = GenderWoman;
      }

      @Override
      public final Gender forNumber(final int value) {
        if (value >= 0 && value < lookup.length) {
          return lookup[value];
        }
        return null;
      }

      @Override
      public final Gender forName(final CharSequence value) {
        if (value.length() == 9) {
          if (ProtoUtil.isEqual("GenderMan", value)) {
            return GenderMan;
          }
        }
        if (value.length() == 10) {
          if (ProtoUtil.isEqual("GenderNone", value)) {
            return GenderNone;
          }
        }
        if (value.length() == 11) {
          if (ProtoUtil.isEqual("GenderWoman", value)) {
            return GenderWoman;
          }
        }
        return null;
      }
    }
  }
}
