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

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

    /**
     * <code>FRIEND_ONLINE_STATUS_OFFLINE = 0;</code>
     */
    public static final int FRIEND_ONLINE_STATUS_OFFLINE_VALUE = 0;

    /**
     * <code>FRIEND_ONLINE_STATUS_ONLINE = 1;</code>
     */
    public static final int FRIEND_ONLINE_STATUS_ONLINE_VALUE = 1;

    private final String name;

    private final int number;

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

    enum FriendOnlineStatusConverter implements ProtoEnum.EnumConverter<FriendOnlineStatus> {
      INSTANCE;

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

      static {
        lookup[0] = FRIEND_ONLINE_STATUS_OFFLINE;
        lookup[1] = FRIEND_ONLINE_STATUS_ONLINE;
      }

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

      @Override
      public final FriendOnlineStatus forName(final CharSequence value) {
        if (value.length() == 27) {
          if (ProtoUtil.isEqual("FRIEND_ONLINE_STATUS_ONLINE", value)) {
            return FRIEND_ONLINE_STATUS_ONLINE;
          }
        }
        if (value.length() == 28) {
          if (ProtoUtil.isEqual("FRIEND_ONLINE_STATUS_OFFLINE", value)) {
            return FRIEND_ONLINE_STATUS_OFFLINE;
          }
        }
        return null;
      }
    }
  }
}
