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

import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedInt;

public final class OfferingInfoOuterClass {
  /**
   * <pre>
   *  EPBFDKPHGKB
   * </pre>
   *
   * Protobuf type {@code OfferingInfo}
   */
  public static final class OfferingInfo extends ProtoMessage<OfferingInfo> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <pre>
     *  LNAJBIJGLEM
     * </pre>
     *
     * <code>optional uint32 total_submitted_num = 8;</code>
     */
    private int totalSubmittedNum;

    /**
     * <pre>
     *  EKDOHEDHBML
     * </pre>
     *
     * <code>optional uint32 offering_level = 12;</code>
     */
    private int offeringLevel;

    /**
     * <pre>
     *  NHJNFGEDACC
     * </pre>
     *
     * <code>optional uint32 offering_id = 13;</code>
     */
    private int offeringId;

    /**
     * <pre>
     *  ADECCLMAAAF
     * </pre>
     *
     * <code>optional uint32 submitted_num = 15;</code>
     */
    private int submittedNum;

    /**
     * <pre>
     *  NLOENEDONMP
     * </pre>
     *
     * <code>optional .OfferingState offering_state = 6;</code>
     */
    private int offeringState;

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     */
    private final RepeatedInt takenRewardLevelList = RepeatedInt.newEmptyInstance();

    private OfferingInfo() {
    }

    /**
     * <pre>
     *  EPBFDKPHGKB
     * </pre>
     *
     * @return a new empty instance of {@code OfferingInfo}
     */
    public static OfferingInfo newInstance() {
      return new OfferingInfo();
    }

    /**
     * <pre>
     *  LNAJBIJGLEM
     * </pre>
     *
     * <code>optional uint32 total_submitted_num = 8;</code>
     * @return whether the totalSubmittedNum field is set
     */
    public boolean hasTotalSubmittedNum() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <pre>
     *  LNAJBIJGLEM
     * </pre>
     *
     * <code>optional uint32 total_submitted_num = 8;</code>
     * @return this
     */
    public OfferingInfo clearTotalSubmittedNum() {
      bitField0_ &= ~0x00000001;
      totalSubmittedNum = 0;
      return this;
    }

    /**
     * <pre>
     *  LNAJBIJGLEM
     * </pre>
     *
     * <code>optional uint32 total_submitted_num = 8;</code>
     * @return the totalSubmittedNum
     */
    public int getTotalSubmittedNum() {
      return totalSubmittedNum;
    }

    /**
     * <pre>
     *  LNAJBIJGLEM
     * </pre>
     *
     * <code>optional uint32 total_submitted_num = 8;</code>
     * @param value the totalSubmittedNum to set
     * @return this
     */
    public OfferingInfo setTotalSubmittedNum(final int value) {
      bitField0_ |= 0x00000001;
      totalSubmittedNum = value;
      return this;
    }

    /**
     * <pre>
     *  EKDOHEDHBML
     * </pre>
     *
     * <code>optional uint32 offering_level = 12;</code>
     * @return whether the offeringLevel field is set
     */
    public boolean hasOfferingLevel() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <pre>
     *  EKDOHEDHBML
     * </pre>
     *
     * <code>optional uint32 offering_level = 12;</code>
     * @return this
     */
    public OfferingInfo clearOfferingLevel() {
      bitField0_ &= ~0x00000002;
      offeringLevel = 0;
      return this;
    }

    /**
     * <pre>
     *  EKDOHEDHBML
     * </pre>
     *
     * <code>optional uint32 offering_level = 12;</code>
     * @return the offeringLevel
     */
    public int getOfferingLevel() {
      return offeringLevel;
    }

    /**
     * <pre>
     *  EKDOHEDHBML
     * </pre>
     *
     * <code>optional uint32 offering_level = 12;</code>
     * @param value the offeringLevel to set
     * @return this
     */
    public OfferingInfo setOfferingLevel(final int value) {
      bitField0_ |= 0x00000002;
      offeringLevel = value;
      return this;
    }

    /**
     * <pre>
     *  NHJNFGEDACC
     * </pre>
     *
     * <code>optional uint32 offering_id = 13;</code>
     * @return whether the offeringId field is set
     */
    public boolean hasOfferingId() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <pre>
     *  NHJNFGEDACC
     * </pre>
     *
     * <code>optional uint32 offering_id = 13;</code>
     * @return this
     */
    public OfferingInfo clearOfferingId() {
      bitField0_ &= ~0x00000004;
      offeringId = 0;
      return this;
    }

    /**
     * <pre>
     *  NHJNFGEDACC
     * </pre>
     *
     * <code>optional uint32 offering_id = 13;</code>
     * @return the offeringId
     */
    public int getOfferingId() {
      return offeringId;
    }

    /**
     * <pre>
     *  NHJNFGEDACC
     * </pre>
     *
     * <code>optional uint32 offering_id = 13;</code>
     * @param value the offeringId to set
     * @return this
     */
    public OfferingInfo setOfferingId(final int value) {
      bitField0_ |= 0x00000004;
      offeringId = value;
      return this;
    }

    /**
     * <pre>
     *  ADECCLMAAAF
     * </pre>
     *
     * <code>optional uint32 submitted_num = 15;</code>
     * @return whether the submittedNum field is set
     */
    public boolean hasSubmittedNum() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <pre>
     *  ADECCLMAAAF
     * </pre>
     *
     * <code>optional uint32 submitted_num = 15;</code>
     * @return this
     */
    public OfferingInfo clearSubmittedNum() {
      bitField0_ &= ~0x00000008;
      submittedNum = 0;
      return this;
    }

    /**
     * <pre>
     *  ADECCLMAAAF
     * </pre>
     *
     * <code>optional uint32 submitted_num = 15;</code>
     * @return the submittedNum
     */
    public int getSubmittedNum() {
      return submittedNum;
    }

    /**
     * <pre>
     *  ADECCLMAAAF
     * </pre>
     *
     * <code>optional uint32 submitted_num = 15;</code>
     * @param value the submittedNum to set
     * @return this
     */
    public OfferingInfo setSubmittedNum(final int value) {
      bitField0_ |= 0x00000008;
      submittedNum = value;
      return this;
    }

    /**
     * <pre>
     *  NLOENEDONMP
     * </pre>
     *
     * <code>optional .OfferingState offering_state = 6;</code>
     * @return whether the offeringState field is set
     */
    public boolean hasOfferingState() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <pre>
     *  NLOENEDONMP
     * </pre>
     *
     * <code>optional .OfferingState offering_state = 6;</code>
     * @return this
     */
    public OfferingInfo clearOfferingState() {
      bitField0_ &= ~0x00000010;
      offeringState = 0;
      return this;
    }

    /**
     * <pre>
     *  NLOENEDONMP
     * </pre>
     *
     * <code>optional .OfferingState offering_state = 6;</code>
     * @return the offeringState
     */
    public OfferingStateOuterClass.OfferingState getOfferingState() {
      return OfferingStateOuterClass.OfferingState.forNumber(offeringState);
    }

    /**
     * Gets the value of the internal enum store. The result is
     * equivalent to {@link OfferingInfo#getOfferingState()}.getNumber().
     *
     * @return numeric wire representation
     */
    public int getOfferingStateValue() {
      return offeringState;
    }

    /**
     * Sets the value of the internal enum store. This does not
     * do any validity checks, so be sure to use appropriate value
     * constants from {@link OfferingStateOuterClass.OfferingState}. Setting an invalid value
     * can cause {@link OfferingInfo#getOfferingState()} to return null
     *
     * @param value the numeric wire value to set
     * @return this
     */
    public OfferingInfo setOfferingStateValue(final int value) {
      bitField0_ |= 0x00000010;
      offeringState = value;
      return this;
    }

    /**
     * <pre>
     *  NLOENEDONMP
     * </pre>
     *
     * <code>optional .OfferingState offering_state = 6;</code>
     * @param value the offeringState to set
     * @return this
     */
    public OfferingInfo setOfferingState(final OfferingStateOuterClass.OfferingState value) {
      bitField0_ |= 0x00000010;
      offeringState = value.getNumber();
      return this;
    }

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     * @return whether the takenRewardLevelList field is set
     */
    public boolean hasTakenRewardLevelList() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     * @return this
     */
    public OfferingInfo clearTakenRewardLevelList() {
      bitField0_ &= ~0x00000020;
      takenRewardLevelList.clear();
      return this;
    }

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableTakenRewardLevelList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedInt getTakenRewardLevelList() {
      return takenRewardLevelList;
    }

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedInt getMutableTakenRewardLevelList() {
      bitField0_ |= 0x00000020;
      return takenRewardLevelList;
    }

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     * @param value the takenRewardLevelList to add
     * @return this
     */
    public OfferingInfo addTakenRewardLevelList(final int value) {
      bitField0_ |= 0x00000020;
      takenRewardLevelList.add(value);
      return this;
    }

    /**
     * <pre>
     *  HNDLHBNPDBO
     * </pre>
     *
     * <code>repeated uint32 taken_reward_level_list = 9;</code>
     * @param values the takenRewardLevelList to add
     * @return this
     */
    public OfferingInfo addAllTakenRewardLevelList(final int... values) {
      bitField0_ |= 0x00000020;
      takenRewardLevelList.addAll(values);
      return this;
    }

    @Override
    public OfferingInfo copyFrom(final OfferingInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        totalSubmittedNum = other.totalSubmittedNum;
        offeringLevel = other.offeringLevel;
        offeringId = other.offeringId;
        submittedNum = other.submittedNum;
        offeringState = other.offeringState;
        takenRewardLevelList.copyFrom(other.takenRewardLevelList);
      }
      return this;
    }

    @Override
    public OfferingInfo mergeFrom(final OfferingInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasTotalSubmittedNum()) {
        setTotalSubmittedNum(other.totalSubmittedNum);
      }
      if (other.hasOfferingLevel()) {
        setOfferingLevel(other.offeringLevel);
      }
      if (other.hasOfferingId()) {
        setOfferingId(other.offeringId);
      }
      if (other.hasSubmittedNum()) {
        setSubmittedNum(other.submittedNum);
      }
      if (other.hasOfferingState()) {
        setOfferingStateValue(other.offeringState);
      }
      if (other.hasTakenRewardLevelList()) {
        getMutableTakenRewardLevelList().addAll(other.takenRewardLevelList);
      }
      return this;
    }

    @Override
    public OfferingInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      totalSubmittedNum = 0;
      offeringLevel = 0;
      offeringId = 0;
      submittedNum = 0;
      offeringState = 0;
      takenRewardLevelList.clear();
      return this;
    }

    @Override
    public OfferingInfo clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      takenRewardLevelList.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof OfferingInfo)) {
        return false;
      }
      OfferingInfo other = (OfferingInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasTotalSubmittedNum() || totalSubmittedNum == other.totalSubmittedNum)
        && (!hasOfferingLevel() || offeringLevel == other.offeringLevel)
        && (!hasOfferingId() || offeringId == other.offeringId)
        && (!hasSubmittedNum() || submittedNum == other.submittedNum)
        && (!hasOfferingState() || offeringState == other.offeringState)
        && (!hasTakenRewardLevelList() || takenRewardLevelList.equals(other.takenRewardLevelList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 64);
        output.writeUInt32NoTag(totalSubmittedNum);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 96);
        output.writeUInt32NoTag(offeringLevel);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 104);
        output.writeUInt32NoTag(offeringId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 120);
        output.writeUInt32NoTag(submittedNum);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 48);
        output.writeEnumNoTag(offeringState);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        for (int i = 0; i < takenRewardLevelList.length(); i++) {
          output.writeRawByte((byte) 72);
          output.writeUInt32NoTag(takenRewardLevelList.array()[i]);
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(totalSubmittedNum);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(offeringLevel);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(offeringId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(submittedNum);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(offeringState);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += (1 * takenRewardLevelList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(takenRewardLevelList);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public OfferingInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 64: {
            // totalSubmittedNum
            totalSubmittedNum = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 96) {
              break;
            }
          }
          case 96: {
            // offeringLevel
            offeringLevel = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 104) {
              break;
            }
          }
          case 104: {
            // offeringId
            offeringId = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 120) {
              break;
            }
          }
          case 120: {
            // submittedNum
            submittedNum = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 48) {
              break;
            }
          }
          case 48: {
            // offeringState
            final int value = input.readInt32();
            if (OfferingStateOuterClass.OfferingState.forNumber(value) != null) {
              offeringState = value;
              bitField0_ |= 0x00000010;
            }
            tag = input.readTag();
            if (tag != 74) {
              break;
            }
          }
          case 74: {
            // takenRewardLevelList [packed=true]
            input.readPackedUInt32(takenRewardLevelList, tag);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 72: {
            // takenRewardLevelList [packed=false]
            tag = input.readRepeatedUInt32(takenRewardLevelList, tag);
            bitField0_ |= 0x00000020;
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.totalSubmittedNum, totalSubmittedNum);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.offeringLevel, offeringLevel);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.offeringId, offeringId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.submittedNum, submittedNum);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeEnum(FieldNames.offeringState, offeringState, OfferingStateOuterClass.OfferingState.converter());
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRepeatedUInt32(FieldNames.takenRewardLevelList, takenRewardLevelList);
      }
      output.endObject();
    }

    @Override
    public OfferingInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -693023249:
          case 1675883655: {
            if (input.isAtField(FieldNames.totalSubmittedNum)) {
              if (!input.trySkipNullValue()) {
                totalSubmittedNum = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1083485982:
          case -221744629: {
            if (input.isAtField(FieldNames.offeringLevel)) {
              if (!input.trySkipNullValue()) {
                offeringLevel = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 170733505:
          case 997792756: {
            if (input.isAtField(FieldNames.offeringId)) {
              if (!input.trySkipNullValue()) {
                offeringId = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2047744885:
          case 944918082: {
            if (input.isAtField(FieldNames.submittedNum)) {
              if (!input.trySkipNullValue()) {
                submittedNum = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1090377771:
          case -214852840: {
            if (input.isAtField(FieldNames.offeringState)) {
              if (!input.trySkipNullValue()) {
                final OfferingStateOuterClass.OfferingState value = input.readEnum(OfferingStateOuterClass.OfferingState.converter());
                if (value != null) {
                  offeringState = value.getNumber();
                  bitField0_ |= 0x00000010;
                } else {
                  input.skipUnknownEnumValue();
                }
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1221470220:
          case 1483712017: {
            if (input.isAtField(FieldNames.takenRewardLevelList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(takenRewardLevelList);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

    @Override
    public OfferingInfo clone() {
      return new OfferingInfo().copyFrom(this);
    }

    @Override
    public boolean isEmpty() {
      return ((bitField0_) == 0);
    }

    public static OfferingInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException {
      return ProtoMessage.mergeFrom(new OfferingInfo(), data).checkInitialized();
    }

    public static OfferingInfo parseFrom(final ProtoSource input) throws IOException {
      return ProtoMessage.mergeFrom(new OfferingInfo(), input).checkInitialized();
    }

    public static OfferingInfo parseFrom(final JsonSource input) throws IOException {
      return ProtoMessage.mergeFrom(new OfferingInfo(), input).checkInitialized();
    }

    /**
     * @return factory for creating OfferingInfo messages
     */
    public static MessageFactory<OfferingInfo> getFactory() {
      return OfferingInfoFactory.INSTANCE;
    }

    private enum OfferingInfoFactory implements MessageFactory<OfferingInfo> {
      INSTANCE;

      @Override
      public OfferingInfo create() {
        return OfferingInfo.newInstance();
      }
    }

    /**
     * Contains name constants used for serializing JSON
     */
    static class FieldNames {
      static final FieldName totalSubmittedNum = FieldName.forField("totalSubmittedNum", "total_submitted_num");

      static final FieldName offeringLevel = FieldName.forField("offeringLevel", "offering_level");

      static final FieldName offeringId = FieldName.forField("offeringId", "offering_id");

      static final FieldName submittedNum = FieldName.forField("submittedNum", "submitted_num");

      static final FieldName offeringState = FieldName.forField("offeringState", "offering_state");

      static final FieldName takenRewardLevelList = FieldName.forField("takenRewardLevelList", "taken_reward_level_list");
    }
  }
}
