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

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

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

    /**
     * <code>OFFERING_STATE_NONE = 0;</code>
     */
    public static final int OFFERING_STATE_NONE_VALUE = 0;

    /**
     * <code>OFFERING_STATE_LOCK = 1;</code>
     */
    public static final int OFFERING_STATE_LOCK_VALUE = 1;

    /**
     * <code>OFFERING_STATE_OPEN = 2;</code>
     */
    public static final int OFFERING_STATE_OPEN_VALUE = 2;

    private final String name;

    private final int number;

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

    enum OfferingStateConverter implements ProtoEnum.EnumConverter<OfferingState> {
      INSTANCE;

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

      static {
        lookup[0] = OFFERING_STATE_NONE;
        lookup[1] = OFFERING_STATE_LOCK;
        lookup[2] = OFFERING_STATE_OPEN;
      }

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

      @Override
      public final OfferingState forName(final CharSequence value) {
        if (value.length() == 19) {
          if (ProtoUtil.isEqual("OFFERING_STATE_NONE", value)) {
            return OFFERING_STATE_NONE;
          }
          if (ProtoUtil.isEqual("OFFERING_STATE_LOCK", value)) {
            return OFFERING_STATE_LOCK;
          }
          if (ProtoUtil.isEqual("OFFERING_STATE_OPEN", value)) {
            return OFFERING_STATE_OPEN;
          }
        }
        return null;
      }
    }
  }
}
