// 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;
import us.hebi.quickbuf.RepeatedMessage;

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

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</code>
     */
    private final RepeatedInt gLHNOAKHHPD = RepeatedInt.newEmptyInstance();

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</code>
     */
    private final RepeatedInt archiveEquipmentIdList = RepeatedInt.newEmptyInstance();

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</code>
     */
    private final RepeatedInt oOICHLFIHLF = RepeatedInt.newEmptyInstance();

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</code>
     */
    private final RepeatedMessage<MonsterArchiveOuterClass.MonsterArchive> monsterList = RepeatedMessage.newEmptyInstance(MonsterArchiveOuterClass.MonsterArchive.getFactory());

    /**
     * <code>repeated .RelicArchive relic_list = 8;</code>
     */
    private final RepeatedMessage<RelicArchiveOuterClass.RelicArchive> relicList = RepeatedMessage.newEmptyInstance(RelicArchiveOuterClass.RelicArchive.getFactory());

    private ArchiveData() {
    }

    /**
     * @return a new empty instance of {@code ArchiveData}
     */
    public static ArchiveData newInstance() {
      return new ArchiveData();
    }

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</code>
     * @return whether the gLHNOAKHHPD field is set
     */
    public boolean hasGLHNOAKHHPD() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</code>
     * @return this
     */
    public ArchiveData clearGLHNOAKHHPD() {
      bitField0_ &= ~0x00000001;
      gLHNOAKHHPD.clear();
      return this;
    }

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</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 #getMutableGLHNOAKHHPD()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedInt getGLHNOAKHHPD() {
      return gLHNOAKHHPD;
    }

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</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 getMutableGLHNOAKHHPD() {
      bitField0_ |= 0x00000001;
      return gLHNOAKHHPD;
    }

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</code>
     * @param value the gLHNOAKHHPD to add
     * @return this
     */
    public ArchiveData addGLHNOAKHHPD(final int value) {
      bitField0_ |= 0x00000001;
      gLHNOAKHHPD.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 GLHNOAKHHPD = 2;</code>
     * @param values the gLHNOAKHHPD to add
     * @return this
     */
    public ArchiveData addAllGLHNOAKHHPD(final int... values) {
      bitField0_ |= 0x00000001;
      gLHNOAKHHPD.addAll(values);
      return this;
    }

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</code>
     * @return whether the archiveEquipmentIdList field is set
     */
    public boolean hasArchiveEquipmentIdList() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</code>
     * @return this
     */
    public ArchiveData clearArchiveEquipmentIdList() {
      bitField0_ &= ~0x00000002;
      archiveEquipmentIdList.clear();
      return this;
    }

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</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 #getMutableArchiveEquipmentIdList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedInt getArchiveEquipmentIdList() {
      return archiveEquipmentIdList;
    }

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</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 getMutableArchiveEquipmentIdList() {
      bitField0_ |= 0x00000002;
      return archiveEquipmentIdList;
    }

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</code>
     * @param value the archiveEquipmentIdList to add
     * @return this
     */
    public ArchiveData addArchiveEquipmentIdList(final int value) {
      bitField0_ |= 0x00000002;
      archiveEquipmentIdList.add(value);
      return this;
    }

    /**
     * <pre>
     *  guessed
     * </pre>
     *
     * <code>repeated uint32 archive_equipment_id_list = 7;</code>
     * @param values the archiveEquipmentIdList to add
     * @return this
     */
    public ArchiveData addAllArchiveEquipmentIdList(final int... values) {
      bitField0_ |= 0x00000002;
      archiveEquipmentIdList.addAll(values);
      return this;
    }

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</code>
     * @return whether the oOICHLFIHLF field is set
     */
    public boolean hasOOICHLFIHLF() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</code>
     * @return this
     */
    public ArchiveData clearOOICHLFIHLF() {
      bitField0_ &= ~0x00000004;
      oOICHLFIHLF.clear();
      return this;
    }

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</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 #getMutableOOICHLFIHLF()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedInt getOOICHLFIHLF() {
      return oOICHLFIHLF;
    }

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</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 getMutableOOICHLFIHLF() {
      bitField0_ |= 0x00000004;
      return oOICHLFIHLF;
    }

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</code>
     * @param value the oOICHLFIHLF to add
     * @return this
     */
    public ArchiveData addOOICHLFIHLF(final int value) {
      bitField0_ |= 0x00000004;
      oOICHLFIHLF.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 OOICHLFIHLF = 12;</code>
     * @param values the oOICHLFIHLF to add
     * @return this
     */
    public ArchiveData addAllOOICHLFIHLF(final int... values) {
      bitField0_ |= 0x00000004;
      oOICHLFIHLF.addAll(values);
      return this;
    }

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</code>
     * @return whether the monsterList field is set
     */
    public boolean hasMonsterList() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</code>
     * @return this
     */
    public ArchiveData clearMonsterList() {
      bitField0_ &= ~0x00000008;
      monsterList.clear();
      return this;
    }

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</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 #getMutableMonsterList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<MonsterArchiveOuterClass.MonsterArchive> getMonsterList() {
      return monsterList;
    }

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</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 RepeatedMessage<MonsterArchiveOuterClass.MonsterArchive> getMutableMonsterList() {
      bitField0_ |= 0x00000008;
      return monsterList;
    }

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</code>
     * @param value the monsterList to add
     * @return this
     */
    public ArchiveData addMonsterList(final MonsterArchiveOuterClass.MonsterArchive value) {
      bitField0_ |= 0x00000008;
      monsterList.add(value);
      return this;
    }

    /**
     * <code>repeated .MonsterArchive monster_list = 6;</code>
     * @param values the monsterList to add
     * @return this
     */
    public ArchiveData addAllMonsterList(final MonsterArchiveOuterClass.MonsterArchive... values) {
      bitField0_ |= 0x00000008;
      monsterList.addAll(values);
      return this;
    }

    /**
     * <code>repeated .RelicArchive relic_list = 8;</code>
     * @return whether the relicList field is set
     */
    public boolean hasRelicList() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>repeated .RelicArchive relic_list = 8;</code>
     * @return this
     */
    public ArchiveData clearRelicList() {
      bitField0_ &= ~0x00000010;
      relicList.clear();
      return this;
    }

    /**
     * <code>repeated .RelicArchive relic_list = 8;</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 #getMutableRelicList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<RelicArchiveOuterClass.RelicArchive> getRelicList() {
      return relicList;
    }

    /**
     * <code>repeated .RelicArchive relic_list = 8;</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 RepeatedMessage<RelicArchiveOuterClass.RelicArchive> getMutableRelicList() {
      bitField0_ |= 0x00000010;
      return relicList;
    }

    /**
     * <code>repeated .RelicArchive relic_list = 8;</code>
     * @param value the relicList to add
     * @return this
     */
    public ArchiveData addRelicList(final RelicArchiveOuterClass.RelicArchive value) {
      bitField0_ |= 0x00000010;
      relicList.add(value);
      return this;
    }

    /**
     * <code>repeated .RelicArchive relic_list = 8;</code>
     * @param values the relicList to add
     * @return this
     */
    public ArchiveData addAllRelicList(final RelicArchiveOuterClass.RelicArchive... values) {
      bitField0_ |= 0x00000010;
      relicList.addAll(values);
      return this;
    }

    @Override
    public ArchiveData copyFrom(final ArchiveData other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        gLHNOAKHHPD.copyFrom(other.gLHNOAKHHPD);
        archiveEquipmentIdList.copyFrom(other.archiveEquipmentIdList);
        oOICHLFIHLF.copyFrom(other.oOICHLFIHLF);
        monsterList.copyFrom(other.monsterList);
        relicList.copyFrom(other.relicList);
      }
      return this;
    }

    @Override
    public ArchiveData mergeFrom(final ArchiveData other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasGLHNOAKHHPD()) {
        getMutableGLHNOAKHHPD().addAll(other.gLHNOAKHHPD);
      }
      if (other.hasArchiveEquipmentIdList()) {
        getMutableArchiveEquipmentIdList().addAll(other.archiveEquipmentIdList);
      }
      if (other.hasOOICHLFIHLF()) {
        getMutableOOICHLFIHLF().addAll(other.oOICHLFIHLF);
      }
      if (other.hasMonsterList()) {
        getMutableMonsterList().addAll(other.monsterList);
      }
      if (other.hasRelicList()) {
        getMutableRelicList().addAll(other.relicList);
      }
      return this;
    }

    @Override
    public ArchiveData clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      gLHNOAKHHPD.clear();
      archiveEquipmentIdList.clear();
      oOICHLFIHLF.clear();
      monsterList.clear();
      relicList.clear();
      return this;
    }

    @Override
    public ArchiveData clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      gLHNOAKHHPD.clear();
      archiveEquipmentIdList.clear();
      oOICHLFIHLF.clear();
      monsterList.clearQuick();
      relicList.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ArchiveData)) {
        return false;
      }
      ArchiveData other = (ArchiveData) o;
      return bitField0_ == other.bitField0_
        && (!hasGLHNOAKHHPD() || gLHNOAKHHPD.equals(other.gLHNOAKHHPD))
        && (!hasArchiveEquipmentIdList() || archiveEquipmentIdList.equals(other.archiveEquipmentIdList))
        && (!hasOOICHLFIHLF() || oOICHLFIHLF.equals(other.oOICHLFIHLF))
        && (!hasMonsterList() || monsterList.equals(other.monsterList))
        && (!hasRelicList() || relicList.equals(other.relicList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        for (int i = 0; i < gLHNOAKHHPD.length(); i++) {
          output.writeRawByte((byte) 16);
          output.writeUInt32NoTag(gLHNOAKHHPD.array()[i]);
        }
      }
      if ((bitField0_ & 0x00000002) != 0) {
        for (int i = 0; i < archiveEquipmentIdList.length(); i++) {
          output.writeRawByte((byte) 56);
          output.writeUInt32NoTag(archiveEquipmentIdList.array()[i]);
        }
      }
      if ((bitField0_ & 0x00000004) != 0) {
        for (int i = 0; i < oOICHLFIHLF.length(); i++) {
          output.writeRawByte((byte) 96);
          output.writeUInt32NoTag(oOICHLFIHLF.array()[i]);
        }
      }
      if ((bitField0_ & 0x00000008) != 0) {
        for (int i = 0; i < monsterList.length(); i++) {
          output.writeRawByte((byte) 50);
          output.writeMessageNoTag(monsterList.get(i));
        }
      }
      if ((bitField0_ & 0x00000010) != 0) {
        for (int i = 0; i < relicList.length(); i++) {
          output.writeRawByte((byte) 66);
          output.writeMessageNoTag(relicList.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += (1 * gLHNOAKHHPD.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(gLHNOAKHHPD);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += (1 * archiveEquipmentIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(archiveEquipmentIdList);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += (1 * oOICHLFIHLF.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(oOICHLFIHLF);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += (1 * monsterList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(monsterList);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += (1 * relicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(relicList);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public ArchiveData mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 18: {
            // gLHNOAKHHPD [packed=true]
            input.readPackedUInt32(gLHNOAKHHPD, tag);
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // archiveEquipmentIdList [packed=true]
            input.readPackedUInt32(archiveEquipmentIdList, tag);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 98) {
              break;
            }
          }
          case 98: {
            // oOICHLFIHLF [packed=true]
            input.readPackedUInt32(oOICHLFIHLF, tag);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // monsterList
            tag = input.readRepeatedMessage(monsterList, tag);
            bitField0_ |= 0x00000008;
            if (tag != 66) {
              break;
            }
          }
          case 66: {
            // relicList
            tag = input.readRepeatedMessage(relicList, tag);
            bitField0_ |= 0x00000010;
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 16: {
            // gLHNOAKHHPD [packed=false]
            tag = input.readRepeatedUInt32(gLHNOAKHHPD, tag);
            bitField0_ |= 0x00000001;
            break;
          }
          case 56: {
            // archiveEquipmentIdList [packed=false]
            tag = input.readRepeatedUInt32(archiveEquipmentIdList, tag);
            bitField0_ |= 0x00000002;
            break;
          }
          case 96: {
            // oOICHLFIHLF [packed=false]
            tag = input.readRepeatedUInt32(oOICHLFIHLF, tag);
            bitField0_ |= 0x00000004;
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRepeatedUInt32(FieldNames.gLHNOAKHHPD, gLHNOAKHHPD);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRepeatedUInt32(FieldNames.archiveEquipmentIdList, archiveEquipmentIdList);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRepeatedUInt32(FieldNames.oOICHLFIHLF, oOICHLFIHLF);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRepeatedMessage(FieldNames.monsterList, monsterList);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRepeatedMessage(FieldNames.relicList, relicList);
      }
      output.endObject();
    }

    @Override
    public ArchiveData mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -246412254: {
            if (input.isAtField(FieldNames.gLHNOAKHHPD)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(gLHNOAKHHPD);
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1521227365:
          case 967463252: {
            if (input.isAtField(FieldNames.archiveEquipmentIdList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(archiveEquipmentIdList);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 857548129: {
            if (input.isAtField(FieldNames.oOICHLFIHLF)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(oOICHLFIHLF);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1541271448:
          case 552401379: {
            if (input.isAtField(FieldNames.monsterList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(monsterList);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 204814001:
          case 2071893482: {
            if (input.isAtField(FieldNames.relicList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(relicList);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum ArchiveDataFactory implements MessageFactory<ArchiveData> {
      INSTANCE;

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

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

      static final FieldName archiveEquipmentIdList = FieldName.forField("archiveEquipmentIdList", "archive_equipment_id_list");

      static final FieldName oOICHLFIHLF = FieldName.forField("OOICHLFIHLF");

      static final FieldName monsterList = FieldName.forField("monsterList", "monster_list");

      static final FieldName relicList = FieldName.forField("relicList", "relic_list");
    }
  }
}
