// 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 RogueMiracleSelectInfoOuterClass {
  /**
   * Protobuf type {@code RogueMiracleSelectInfo}
   */
  public static final class RogueMiracleSelectInfo extends ProtoMessage<RogueMiracleSelectInfo> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional bool show_handbook_hint = 15;</code>
     */
    private boolean showHandbookHint;

    /**
     * <code>optional .RogueAchivedMiracleInfo achived_miracle_info = 7;</code>
     */
    private final RogueAchivedMiracleInfoOuterClass.RogueAchivedMiracleInfo achivedMiracleInfo = RogueAchivedMiracleInfoOuterClass.RogueAchivedMiracleInfo.newInstance();

    /**
     * <code>repeated uint32 miracle_id_list = 8;</code>
     */
    private final RepeatedInt miracleIdList = RepeatedInt.newEmptyInstance();

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

    private RogueMiracleSelectInfo() {
    }

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

    /**
     * <code>optional bool show_handbook_hint = 15;</code>
     * @return whether the showHandbookHint field is set
     */
    public boolean hasShowHandbookHint() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional bool show_handbook_hint = 15;</code>
     * @return this
     */
    public RogueMiracleSelectInfo clearShowHandbookHint() {
      bitField0_ &= ~0x00000001;
      showHandbookHint = false;
      return this;
    }

    /**
     * <code>optional bool show_handbook_hint = 15;</code>
     * @return the showHandbookHint
     */
    public boolean getShowHandbookHint() {
      return showHandbookHint;
    }

    /**
     * <code>optional bool show_handbook_hint = 15;</code>
     * @param value the showHandbookHint to set
     * @return this
     */
    public RogueMiracleSelectInfo setShowHandbookHint(final boolean value) {
      bitField0_ |= 0x00000001;
      showHandbookHint = value;
      return this;
    }

    /**
     * <code>optional .RogueAchivedMiracleInfo achived_miracle_info = 7;</code>
     * @return whether the achivedMiracleInfo field is set
     */
    public boolean hasAchivedMiracleInfo() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .RogueAchivedMiracleInfo achived_miracle_info = 7;</code>
     * @return this
     */
    public RogueMiracleSelectInfo clearAchivedMiracleInfo() {
      bitField0_ &= ~0x00000002;
      achivedMiracleInfo.clear();
      return this;
    }

    /**
     * <code>optional .RogueAchivedMiracleInfo achived_miracle_info = 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 #getMutableAchivedMiracleInfo()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RogueAchivedMiracleInfoOuterClass.RogueAchivedMiracleInfo getAchivedMiracleInfo() {
      return achivedMiracleInfo;
    }

    /**
     * <code>optional .RogueAchivedMiracleInfo achived_miracle_info = 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 RogueAchivedMiracleInfoOuterClass.RogueAchivedMiracleInfo getMutableAchivedMiracleInfo(
        ) {
      bitField0_ |= 0x00000002;
      return achivedMiracleInfo;
    }

    /**
     * <code>optional .RogueAchivedMiracleInfo achived_miracle_info = 7;</code>
     * @param value the achivedMiracleInfo to set
     * @return this
     */
    public RogueMiracleSelectInfo setAchivedMiracleInfo(
        final RogueAchivedMiracleInfoOuterClass.RogueAchivedMiracleInfo value) {
      bitField0_ |= 0x00000002;
      achivedMiracleInfo.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated uint32 miracle_id_list = 8;</code>
     * @return whether the miracleIdList field is set
     */
    public boolean hasMiracleIdList() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated uint32 miracle_id_list = 8;</code>
     * @return this
     */
    public RogueMiracleSelectInfo clearMiracleIdList() {
      bitField0_ &= ~0x00000004;
      miracleIdList.clear();
      return this;
    }

    /**
     * <code>repeated uint32 miracle_id_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 #getMutableMiracleIdList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedInt getMiracleIdList() {
      return miracleIdList;
    }

    /**
     * <code>repeated uint32 miracle_id_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 RepeatedInt getMutableMiracleIdList() {
      bitField0_ |= 0x00000004;
      return miracleIdList;
    }

    /**
     * <code>repeated uint32 miracle_id_list = 8;</code>
     * @param value the miracleIdList to add
     * @return this
     */
    public RogueMiracleSelectInfo addMiracleIdList(final int value) {
      bitField0_ |= 0x00000004;
      miracleIdList.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 miracle_id_list = 8;</code>
     * @param values the miracleIdList to add
     * @return this
     */
    public RogueMiracleSelectInfo addAllMiracleIdList(final int... values) {
      bitField0_ |= 0x00000004;
      miracleIdList.addAll(values);
      return this;
    }

    /**
     * <code>repeated uint32 FBCFOBKNEJB = 12;</code>
     * @return whether the fBCFOBKNEJB field is set
     */
    public boolean hasFBCFOBKNEJB() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>repeated uint32 FBCFOBKNEJB = 12;</code>
     * @return this
     */
    public RogueMiracleSelectInfo clearFBCFOBKNEJB() {
      bitField0_ &= ~0x00000008;
      fBCFOBKNEJB.clear();
      return this;
    }

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

    /**
     * <code>repeated uint32 FBCFOBKNEJB = 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 getMutableFBCFOBKNEJB() {
      bitField0_ |= 0x00000008;
      return fBCFOBKNEJB;
    }

    /**
     * <code>repeated uint32 FBCFOBKNEJB = 12;</code>
     * @param value the fBCFOBKNEJB to add
     * @return this
     */
    public RogueMiracleSelectInfo addFBCFOBKNEJB(final int value) {
      bitField0_ |= 0x00000008;
      fBCFOBKNEJB.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 FBCFOBKNEJB = 12;</code>
     * @param values the fBCFOBKNEJB to add
     * @return this
     */
    public RogueMiracleSelectInfo addAllFBCFOBKNEJB(final int... values) {
      bitField0_ |= 0x00000008;
      fBCFOBKNEJB.addAll(values);
      return this;
    }

    @Override
    public RogueMiracleSelectInfo copyFrom(final RogueMiracleSelectInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        showHandbookHint = other.showHandbookHint;
        achivedMiracleInfo.copyFrom(other.achivedMiracleInfo);
        miracleIdList.copyFrom(other.miracleIdList);
        fBCFOBKNEJB.copyFrom(other.fBCFOBKNEJB);
      }
      return this;
    }

    @Override
    public RogueMiracleSelectInfo mergeFrom(final RogueMiracleSelectInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasShowHandbookHint()) {
        setShowHandbookHint(other.showHandbookHint);
      }
      if (other.hasAchivedMiracleInfo()) {
        getMutableAchivedMiracleInfo().mergeFrom(other.achivedMiracleInfo);
      }
      if (other.hasMiracleIdList()) {
        getMutableMiracleIdList().addAll(other.miracleIdList);
      }
      if (other.hasFBCFOBKNEJB()) {
        getMutableFBCFOBKNEJB().addAll(other.fBCFOBKNEJB);
      }
      return this;
    }

    @Override
    public RogueMiracleSelectInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      showHandbookHint = false;
      achivedMiracleInfo.clear();
      miracleIdList.clear();
      fBCFOBKNEJB.clear();
      return this;
    }

    @Override
    public RogueMiracleSelectInfo clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      achivedMiracleInfo.clearQuick();
      miracleIdList.clear();
      fBCFOBKNEJB.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof RogueMiracleSelectInfo)) {
        return false;
      }
      RogueMiracleSelectInfo other = (RogueMiracleSelectInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasShowHandbookHint() || showHandbookHint == other.showHandbookHint)
        && (!hasAchivedMiracleInfo() || achivedMiracleInfo.equals(other.achivedMiracleInfo))
        && (!hasMiracleIdList() || miracleIdList.equals(other.miracleIdList))
        && (!hasFBCFOBKNEJB() || fBCFOBKNEJB.equals(other.fBCFOBKNEJB));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 120);
        output.writeBoolNoTag(showHandbookHint);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 58);
        output.writeMessageNoTag(achivedMiracleInfo);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        for (int i = 0; i < miracleIdList.length(); i++) {
          output.writeRawByte((byte) 64);
          output.writeUInt32NoTag(miracleIdList.array()[i]);
        }
      }
      if ((bitField0_ & 0x00000008) != 0) {
        for (int i = 0; i < fBCFOBKNEJB.length(); i++) {
          output.writeRawByte((byte) 96);
          output.writeUInt32NoTag(fBCFOBKNEJB.array()[i]);
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(achivedMiracleInfo);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += (1 * miracleIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(miracleIdList);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += (1 * fBCFOBKNEJB.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(fBCFOBKNEJB);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public RogueMiracleSelectInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 120: {
            // showHandbookHint
            showHandbookHint = input.readBool();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // achivedMiracleInfo
            input.readMessage(achivedMiracleInfo);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 66) {
              break;
            }
          }
          case 66: {
            // miracleIdList [packed=true]
            input.readPackedUInt32(miracleIdList, tag);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 98) {
              break;
            }
          }
          case 98: {
            // fBCFOBKNEJB [packed=true]
            input.readPackedUInt32(fBCFOBKNEJB, tag);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 64: {
            // miracleIdList [packed=false]
            tag = input.readRepeatedUInt32(miracleIdList, tag);
            bitField0_ |= 0x00000004;
            break;
          }
          case 96: {
            // fBCFOBKNEJB [packed=false]
            tag = input.readRepeatedUInt32(fBCFOBKNEJB, tag);
            bitField0_ |= 0x00000008;
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeBool(FieldNames.showHandbookHint, showHandbookHint);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeMessage(FieldNames.achivedMiracleInfo, achivedMiracleInfo);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRepeatedUInt32(FieldNames.miracleIdList, miracleIdList);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRepeatedUInt32(FieldNames.fBCFOBKNEJB, fBCFOBKNEJB);
      }
      output.endObject();
    }

    @Override
    public RogueMiracleSelectInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -1843696100:
          case 641745100: {
            if (input.isAtField(FieldNames.showHandbookHint)) {
              if (!input.trySkipNullValue()) {
                showHandbookHint = input.readBool();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -213623475:
          case -431790391: {
            if (input.isAtField(FieldNames.achivedMiracleInfo)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(achivedMiracleInfo);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 500458538:
          case 411639668: {
            if (input.isAtField(FieldNames.miracleIdList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(miracleIdList);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1360731384: {
            if (input.isAtField(FieldNames.fBCFOBKNEJB)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(fBCFOBKNEJB);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum RogueMiracleSelectInfoFactory implements MessageFactory<RogueMiracleSelectInfo> {
      INSTANCE;

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

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

      static final FieldName achivedMiracleInfo = FieldName.forField("achivedMiracleInfo", "achived_miracle_info");

      static final FieldName miracleIdList = FieldName.forField("miracleIdList", "miracle_id_list");

      static final FieldName fBCFOBKNEJB = FieldName.forField("FBCFOBKNEJB");
    }
  }
}
