// 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.RepeatedByte;

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

    /**
     * <code>optional uint32 MPOHFMFDLAB = 4;</code>
     */
    private int mPOHFMFDLAB;

    /**
     * <code>optional uint32 promotion = 11;</code>
     */
    private int promotion;

    /**
     * <code>optional uint32 JEAHPAAOAOM = 12;</code>
     */
    private int jEAHPAAOAOM;

    /**
     * <code>optional .MotionInfo JNAMJNFMNAM = 2;</code>
     */
    private final MotionInfoOuterClass.MotionInfo jNAMJNFMNAM = MotionInfoOuterClass.MotionInfo.newInstance();

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</code>
     */
    private final RepeatedByte jOEKOGCLFAA = RepeatedByte.newEmptyInstance();

    private SwitchHandData() {
    }

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

    /**
     * <code>optional uint32 MPOHFMFDLAB = 4;</code>
     * @return whether the mPOHFMFDLAB field is set
     */
    public boolean hasMPOHFMFDLAB() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 MPOHFMFDLAB = 4;</code>
     * @return this
     */
    public SwitchHandData clearMPOHFMFDLAB() {
      bitField0_ &= ~0x00000001;
      mPOHFMFDLAB = 0;
      return this;
    }

    /**
     * <code>optional uint32 MPOHFMFDLAB = 4;</code>
     * @return the mPOHFMFDLAB
     */
    public int getMPOHFMFDLAB() {
      return mPOHFMFDLAB;
    }

    /**
     * <code>optional uint32 MPOHFMFDLAB = 4;</code>
     * @param value the mPOHFMFDLAB to set
     * @return this
     */
    public SwitchHandData setMPOHFMFDLAB(final int value) {
      bitField0_ |= 0x00000001;
      mPOHFMFDLAB = value;
      return this;
    }

    /**
     * <code>optional uint32 promotion = 11;</code>
     * @return whether the promotion field is set
     */
    public boolean hasPromotion() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 promotion = 11;</code>
     * @return this
     */
    public SwitchHandData clearPromotion() {
      bitField0_ &= ~0x00000002;
      promotion = 0;
      return this;
    }

    /**
     * <code>optional uint32 promotion = 11;</code>
     * @return the promotion
     */
    public int getPromotion() {
      return promotion;
    }

    /**
     * <code>optional uint32 promotion = 11;</code>
     * @param value the promotion to set
     * @return this
     */
    public SwitchHandData setPromotion(final int value) {
      bitField0_ |= 0x00000002;
      promotion = value;
      return this;
    }

    /**
     * <code>optional uint32 JEAHPAAOAOM = 12;</code>
     * @return whether the jEAHPAAOAOM field is set
     */
    public boolean hasJEAHPAAOAOM() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional uint32 JEAHPAAOAOM = 12;</code>
     * @return this
     */
    public SwitchHandData clearJEAHPAAOAOM() {
      bitField0_ &= ~0x00000004;
      jEAHPAAOAOM = 0;
      return this;
    }

    /**
     * <code>optional uint32 JEAHPAAOAOM = 12;</code>
     * @return the jEAHPAAOAOM
     */
    public int getJEAHPAAOAOM() {
      return jEAHPAAOAOM;
    }

    /**
     * <code>optional uint32 JEAHPAAOAOM = 12;</code>
     * @param value the jEAHPAAOAOM to set
     * @return this
     */
    public SwitchHandData setJEAHPAAOAOM(final int value) {
      bitField0_ |= 0x00000004;
      jEAHPAAOAOM = value;
      return this;
    }

    /**
     * <code>optional .MotionInfo JNAMJNFMNAM = 2;</code>
     * @return whether the jNAMJNFMNAM field is set
     */
    public boolean hasJNAMJNFMNAM() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional .MotionInfo JNAMJNFMNAM = 2;</code>
     * @return this
     */
    public SwitchHandData clearJNAMJNFMNAM() {
      bitField0_ &= ~0x00000008;
      jNAMJNFMNAM.clear();
      return this;
    }

    /**
     * <code>optional .MotionInfo JNAMJNFMNAM = 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 #getMutableJNAMJNFMNAM()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public MotionInfoOuterClass.MotionInfo getJNAMJNFMNAM() {
      return jNAMJNFMNAM;
    }

    /**
     * <code>optional .MotionInfo JNAMJNFMNAM = 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 MotionInfoOuterClass.MotionInfo getMutableJNAMJNFMNAM() {
      bitField0_ |= 0x00000008;
      return jNAMJNFMNAM;
    }

    /**
     * <code>optional .MotionInfo JNAMJNFMNAM = 2;</code>
     * @param value the jNAMJNFMNAM to set
     * @return this
     */
    public SwitchHandData setJNAMJNFMNAM(final MotionInfoOuterClass.MotionInfo value) {
      bitField0_ |= 0x00000008;
      jNAMJNFMNAM.copyFrom(value);
      return this;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</code>
     * @return whether the jOEKOGCLFAA field is set
     */
    public boolean hasJOEKOGCLFAA() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</code>
     * @return this
     */
    public SwitchHandData clearJOEKOGCLFAA() {
      bitField0_ &= ~0x00000010;
      jOEKOGCLFAA.clear();
      return this;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</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 #getMutableJOEKOGCLFAA()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getJOEKOGCLFAA() {
      return jOEKOGCLFAA;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</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 RepeatedByte getMutableJOEKOGCLFAA() {
      bitField0_ |= 0x00000010;
      return jOEKOGCLFAA;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</code>
     * @param value the jOEKOGCLFAA to add
     * @return this
     */
    public SwitchHandData addJOEKOGCLFAA(final byte value) {
      bitField0_ |= 0x00000010;
      jOEKOGCLFAA.add(value);
      return this;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</code>
     * @param values the jOEKOGCLFAA to add
     * @return this
     */
    public SwitchHandData addAllJOEKOGCLFAA(final byte... values) {
      bitField0_ |= 0x00000010;
      jOEKOGCLFAA.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes JOEKOGCLFAA = 14;</code>
     * @param values the jOEKOGCLFAA to set
     * @return this
     */
    public SwitchHandData setJOEKOGCLFAA(final byte... values) {
      bitField0_ |= 0x00000010;
      jOEKOGCLFAA.copyFrom(values);
      return this;
    }

    @Override
    public SwitchHandData copyFrom(final SwitchHandData other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        mPOHFMFDLAB = other.mPOHFMFDLAB;
        promotion = other.promotion;
        jEAHPAAOAOM = other.jEAHPAAOAOM;
        jNAMJNFMNAM.copyFrom(other.jNAMJNFMNAM);
        jOEKOGCLFAA.copyFrom(other.jOEKOGCLFAA);
      }
      return this;
    }

    @Override
    public SwitchHandData mergeFrom(final SwitchHandData other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasMPOHFMFDLAB()) {
        setMPOHFMFDLAB(other.mPOHFMFDLAB);
      }
      if (other.hasPromotion()) {
        setPromotion(other.promotion);
      }
      if (other.hasJEAHPAAOAOM()) {
        setJEAHPAAOAOM(other.jEAHPAAOAOM);
      }
      if (other.hasJNAMJNFMNAM()) {
        getMutableJNAMJNFMNAM().mergeFrom(other.jNAMJNFMNAM);
      }
      if (other.hasJOEKOGCLFAA()) {
        getMutableJOEKOGCLFAA().copyFrom(other.jOEKOGCLFAA);
      }
      return this;
    }

    @Override
    public SwitchHandData clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      mPOHFMFDLAB = 0;
      promotion = 0;
      jEAHPAAOAOM = 0;
      jNAMJNFMNAM.clear();
      jOEKOGCLFAA.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof SwitchHandData)) {
        return false;
      }
      SwitchHandData other = (SwitchHandData) o;
      return bitField0_ == other.bitField0_
        && (!hasMPOHFMFDLAB() || mPOHFMFDLAB == other.mPOHFMFDLAB)
        && (!hasPromotion() || promotion == other.promotion)
        && (!hasJEAHPAAOAOM() || jEAHPAAOAOM == other.jEAHPAAOAOM)
        && (!hasJNAMJNFMNAM() || jNAMJNFMNAM.equals(other.jNAMJNFMNAM))
        && (!hasJOEKOGCLFAA() || jOEKOGCLFAA.equals(other.jOEKOGCLFAA));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(mPOHFMFDLAB);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 88);
        output.writeUInt32NoTag(promotion);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 96);
        output.writeUInt32NoTag(jEAHPAAOAOM);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 18);
        output.writeMessageNoTag(jNAMJNFMNAM);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 114);
        output.writeBytesNoTag(jOEKOGCLFAA);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(mPOHFMFDLAB);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(promotion);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(jEAHPAAOAOM);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(jNAMJNFMNAM);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeBytesSizeNoTag(jOEKOGCLFAA);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public SwitchHandData mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 32: {
            // mPOHFMFDLAB
            mPOHFMFDLAB = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 88) {
              break;
            }
          }
          case 88: {
            // promotion
            promotion = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 96) {
              break;
            }
          }
          case 96: {
            // jEAHPAAOAOM
            jEAHPAAOAOM = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // jNAMJNFMNAM
            input.readMessage(jNAMJNFMNAM);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 114) {
              break;
            }
          }
          case 114: {
            // jOEKOGCLFAA
            input.readBytes(jOEKOGCLFAA);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.mPOHFMFDLAB, mPOHFMFDLAB);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.promotion, promotion);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.jEAHPAAOAOM, jEAHPAAOAOM);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeMessage(FieldNames.jNAMJNFMNAM, jNAMJNFMNAM);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeBytes(FieldNames.jOEKOGCLFAA, jOEKOGCLFAA);
      }
      output.endObject();
    }

    @Override
    public SwitchHandData mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 377738572: {
            if (input.isAtField(FieldNames.mPOHFMFDLAB)) {
              if (!input.trySkipNullValue()) {
                mPOHFMFDLAB = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -799212381: {
            if (input.isAtField(FieldNames.promotion)) {
              if (!input.trySkipNullValue()) {
                promotion = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1187882306: {
            if (input.isAtField(FieldNames.jEAHPAAOAOM)) {
              if (!input.trySkipNullValue()) {
                jEAHPAAOAOM = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 809274783: {
            if (input.isAtField(FieldNames.jNAMJNFMNAM)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(jNAMJNFMNAM);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1573403654: {
            if (input.isAtField(FieldNames.jOEKOGCLFAA)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(jOEKOGCLFAA);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum SwitchHandDataFactory implements MessageFactory<SwitchHandData> {
      INSTANCE;

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

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

      static final FieldName promotion = FieldName.forField("promotion");

      static final FieldName jEAHPAAOAOM = FieldName.forField("JEAHPAAOAOM");

      static final FieldName jNAMJNFMNAM = FieldName.forField("JNAMJNFMNAM");

      static final FieldName jOEKOGCLFAA = FieldName.forField("JOEKOGCLFAA");
    }
  }
}
