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

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

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

    /**
     * <code>CHAT_TYPE_NONE = 0;</code>
     */
    public static final int CHAT_TYPE_NONE_VALUE = 0;

    /**
     * <code>CHAT_TYPE_PRIVATE = 1;</code>
     */
    public static final int CHAT_TYPE_PRIVATE_VALUE = 1;

    /**
     * <code>CHAT_TYPE_GROUP = 2;</code>
     */
    public static final int CHAT_TYPE_GROUP_VALUE = 2;

    private final String name;

    private final int number;

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

    enum ChatTypeConverter implements ProtoEnum.EnumConverter<ChatType> {
      INSTANCE;

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

      static {
        lookup[0] = CHAT_TYPE_NONE;
        lookup[1] = CHAT_TYPE_PRIVATE;
        lookup[2] = CHAT_TYPE_GROUP;
      }

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

      @Override
      public final ChatType forName(final CharSequence value) {
        if (value.length() == 14) {
          if (ProtoUtil.isEqual("CHAT_TYPE_NONE", value)) {
            return CHAT_TYPE_NONE;
          }
        }
        if (value.length() == 15) {
          if (ProtoUtil.isEqual("CHAT_TYPE_GROUP", value)) {
            return CHAT_TYPE_GROUP;
          }
        }
        if (value.length() == 17) {
          if (ProtoUtil.isEqual("CHAT_TYPE_PRIVATE", value)) {
            return CHAT_TYPE_PRIVATE;
          }
        }
        return null;
      }
    }
  }
}
