// 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 MailTypeOuterClass {
  /**
   * Protobuf enum {@code MailType}
   */
  public enum MailType implements ProtoEnum<MailType> {
    /**
     * <code>MAIL_TYPE_NORMAL = 0;</code>
     */
    MAIL_TYPE_NORMAL("MAIL_TYPE_NORMAL", 0),

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

    /**
     * <code>MAIL_TYPE_NORMAL = 0;</code>
     */
    public static final int MAIL_TYPE_NORMAL_VALUE = 0;

    /**
     * <code>MAIL_TYPE_STAR = 1;</code>
     */
    public static final int MAIL_TYPE_STAR_VALUE = 1;

    private final String name;

    private final int number;

    private MailType(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<MailType> converter() {
      return MailTypeConverter.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 MailType forNumber(int value) {
      return MailTypeConverter.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 MailType forNumberOr(int number, MailType other) {
      MailType value = forNumber(number);
      return value == null ? other : value;
    }

    enum MailTypeConverter implements ProtoEnum.EnumConverter<MailType> {
      INSTANCE;

      private static final MailType[] lookup = new MailType[2];

      static {
        lookup[0] = MAIL_TYPE_NORMAL;
        lookup[1] = MAIL_TYPE_STAR;
      }

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

      @Override
      public final MailType forName(final CharSequence value) {
        if (value.length() == 14) {
          if (ProtoUtil.isEqual("MAIL_TYPE_STAR", value)) {
            return MAIL_TYPE_STAR;
          }
        }
        if (value.length() == 16) {
          if (ProtoUtil.isEqual("MAIL_TYPE_NORMAL", value)) {
            return MAIL_TYPE_NORMAL;
          }
        }
        return null;
      }
    }
  }
}
