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

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

    /**
     * <pre>
     *  JODPMEDMPJK
     * </pre>
     *
     * <code>optional uint32 entry_id = 4;</code>
     */
    private int entryId;

    /**
     * <pre>
     *  HEDLHGFPCGG
     * </pre>
     *
     * <code>optional uint32 group_id = 11;</code>
     */
    private int groupId;

    /**
     * <pre>
     *  JDLHKMNFDBD
     * </pre>
     *
     * <code>optional uint32 retcode = 15;</code>
     */
    private int retcode;

    private SetGroupCustomSaveDataScRsp() {
    }

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

    /**
     * <pre>
     *  JODPMEDMPJK
     * </pre>
     *
     * <code>optional uint32 entry_id = 4;</code>
     * @return whether the entryId field is set
     */
    public boolean hasEntryId() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <pre>
     *  JODPMEDMPJK
     * </pre>
     *
     * <code>optional uint32 entry_id = 4;</code>
     * @return this
     */
    public SetGroupCustomSaveDataScRsp clearEntryId() {
      bitField0_ &= ~0x00000001;
      entryId = 0;
      return this;
    }

    /**
     * <pre>
     *  JODPMEDMPJK
     * </pre>
     *
     * <code>optional uint32 entry_id = 4;</code>
     * @return the entryId
     */
    public int getEntryId() {
      return entryId;
    }

    /**
     * <pre>
     *  JODPMEDMPJK
     * </pre>
     *
     * <code>optional uint32 entry_id = 4;</code>
     * @param value the entryId to set
     * @return this
     */
    public SetGroupCustomSaveDataScRsp setEntryId(final int value) {
      bitField0_ |= 0x00000001;
      entryId = value;
      return this;
    }

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

    /**
     * <pre>
     *  HEDLHGFPCGG
     * </pre>
     *
     * <code>optional uint32 group_id = 11;</code>
     * @return this
     */
    public SetGroupCustomSaveDataScRsp clearGroupId() {
      bitField0_ &= ~0x00000002;
      groupId = 0;
      return this;
    }

    /**
     * <pre>
     *  HEDLHGFPCGG
     * </pre>
     *
     * <code>optional uint32 group_id = 11;</code>
     * @return the groupId
     */
    public int getGroupId() {
      return groupId;
    }

    /**
     * <pre>
     *  HEDLHGFPCGG
     * </pre>
     *
     * <code>optional uint32 group_id = 11;</code>
     * @param value the groupId to set
     * @return this
     */
    public SetGroupCustomSaveDataScRsp setGroupId(final int value) {
      bitField0_ |= 0x00000002;
      groupId = value;
      return this;
    }

    /**
     * <pre>
     *  JDLHKMNFDBD
     * </pre>
     *
     * <code>optional uint32 retcode = 15;</code>
     * @return whether the retcode field is set
     */
    public boolean hasRetcode() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <pre>
     *  JDLHKMNFDBD
     * </pre>
     *
     * <code>optional uint32 retcode = 15;</code>
     * @return this
     */
    public SetGroupCustomSaveDataScRsp clearRetcode() {
      bitField0_ &= ~0x00000004;
      retcode = 0;
      return this;
    }

    /**
     * <pre>
     *  JDLHKMNFDBD
     * </pre>
     *
     * <code>optional uint32 retcode = 15;</code>
     * @return the retcode
     */
    public int getRetcode() {
      return retcode;
    }

    /**
     * <pre>
     *  JDLHKMNFDBD
     * </pre>
     *
     * <code>optional uint32 retcode = 15;</code>
     * @param value the retcode to set
     * @return this
     */
    public SetGroupCustomSaveDataScRsp setRetcode(final int value) {
      bitField0_ |= 0x00000004;
      retcode = value;
      return this;
    }

    @Override
    public SetGroupCustomSaveDataScRsp copyFrom(final SetGroupCustomSaveDataScRsp other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        entryId = other.entryId;
        groupId = other.groupId;
        retcode = other.retcode;
      }
      return this;
    }

    @Override
    public SetGroupCustomSaveDataScRsp mergeFrom(final SetGroupCustomSaveDataScRsp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasEntryId()) {
        setEntryId(other.entryId);
      }
      if (other.hasGroupId()) {
        setGroupId(other.groupId);
      }
      if (other.hasRetcode()) {
        setRetcode(other.retcode);
      }
      return this;
    }

    @Override
    public SetGroupCustomSaveDataScRsp clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      entryId = 0;
      groupId = 0;
      retcode = 0;
      return this;
    }

    @Override
    public SetGroupCustomSaveDataScRsp clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof SetGroupCustomSaveDataScRsp)) {
        return false;
      }
      SetGroupCustomSaveDataScRsp other = (SetGroupCustomSaveDataScRsp) o;
      return bitField0_ == other.bitField0_
        && (!hasEntryId() || entryId == other.entryId)
        && (!hasGroupId() || groupId == other.groupId)
        && (!hasRetcode() || retcode == other.retcode);
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(entryId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 88);
        output.writeUInt32NoTag(groupId);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 120);
        output.writeUInt32NoTag(retcode);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(entryId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public SetGroupCustomSaveDataScRsp mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 32: {
            // entryId
            entryId = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 88) {
              break;
            }
          }
          case 88: {
            // groupId
            groupId = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 120) {
              break;
            }
          }
          case 120: {
            // retcode
            retcode = input.readUInt32();
            bitField0_ |= 0x00000004;
            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.entryId, entryId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.groupId, groupId);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.retcode, retcode);
      }
      output.endObject();
    }

    @Override
    public SetGroupCustomSaveDataScRsp mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -1591558867:
          case -2093663224: {
            if (input.isAtField(FieldNames.entryId)) {
              if (!input.trySkipNullValue()) {
                entryId = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 293428218:
          case 506361563: {
            if (input.isAtField(FieldNames.groupId)) {
              if (!input.trySkipNullValue()) {
                groupId = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1097936398: {
            if (input.isAtField(FieldNames.retcode)) {
              if (!input.trySkipNullValue()) {
                retcode = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum SetGroupCustomSaveDataScRspFactory implements MessageFactory<SetGroupCustomSaveDataScRsp> {
      INSTANCE;

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

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

      static final FieldName groupId = FieldName.forField("groupId", "group_id");

      static final FieldName retcode = FieldName.forField("retcode");
    }
  }
}
