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

    /**
     * <code>optional uint32 retcode = 2;</code>
     */
    private int retcode;

    /**
     * <pre>
     *  DLCIALOCJDC
     * </pre>
     *
     * <code>optional uint32 daily_active_point = 14;</code>
     */
    private int dailyActivePoint;

    /**
     * <code>repeated uint32 daily_active_quest_id_list = 10;</code>
     */
    private final RepeatedInt dailyActiveQuestIdList = RepeatedInt.newEmptyInstance();

    /**
     * <code>repeated .DailyActivityInfo daily_active_level_list = 9;</code>
     */
    private final RepeatedMessage<DailyActivityInfoOuterClass.DailyActivityInfo> dailyActiveLevelList = RepeatedMessage.newEmptyInstance(DailyActivityInfoOuterClass.DailyActivityInfo.getFactory());

    private GetDailyActiveInfoScRsp() {
    }

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

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

    /**
     * <code>optional uint32 retcode = 2;</code>
     * @return this
     */
    public GetDailyActiveInfoScRsp clearRetcode() {
      bitField0_ &= ~0x00000001;
      retcode = 0;
      return this;
    }

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

    /**
     * <code>optional uint32 retcode = 2;</code>
     * @param value the retcode to set
     * @return this
     */
    public GetDailyActiveInfoScRsp setRetcode(final int value) {
      bitField0_ |= 0x00000001;
      retcode = value;
      return this;
    }

    /**
     * <pre>
     *  DLCIALOCJDC
     * </pre>
     *
     * <code>optional uint32 daily_active_point = 14;</code>
     * @return whether the dailyActivePoint field is set
     */
    public boolean hasDailyActivePoint() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <pre>
     *  DLCIALOCJDC
     * </pre>
     *
     * <code>optional uint32 daily_active_point = 14;</code>
     * @return this
     */
    public GetDailyActiveInfoScRsp clearDailyActivePoint() {
      bitField0_ &= ~0x00000002;
      dailyActivePoint = 0;
      return this;
    }

    /**
     * <pre>
     *  DLCIALOCJDC
     * </pre>
     *
     * <code>optional uint32 daily_active_point = 14;</code>
     * @return the dailyActivePoint
     */
    public int getDailyActivePoint() {
      return dailyActivePoint;
    }

    /**
     * <pre>
     *  DLCIALOCJDC
     * </pre>
     *
     * <code>optional uint32 daily_active_point = 14;</code>
     * @param value the dailyActivePoint to set
     * @return this
     */
    public GetDailyActiveInfoScRsp setDailyActivePoint(final int value) {
      bitField0_ |= 0x00000002;
      dailyActivePoint = value;
      return this;
    }

    /**
     * <code>repeated uint32 daily_active_quest_id_list = 10;</code>
     * @return whether the dailyActiveQuestIdList field is set
     */
    public boolean hasDailyActiveQuestIdList() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated uint32 daily_active_quest_id_list = 10;</code>
     * @return this
     */
    public GetDailyActiveInfoScRsp clearDailyActiveQuestIdList() {
      bitField0_ &= ~0x00000004;
      dailyActiveQuestIdList.clear();
      return this;
    }

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

    /**
     * <code>repeated uint32 daily_active_quest_id_list = 10;</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 getMutableDailyActiveQuestIdList() {
      bitField0_ |= 0x00000004;
      return dailyActiveQuestIdList;
    }

    /**
     * <code>repeated uint32 daily_active_quest_id_list = 10;</code>
     * @param value the dailyActiveQuestIdList to add
     * @return this
     */
    public GetDailyActiveInfoScRsp addDailyActiveQuestIdList(final int value) {
      bitField0_ |= 0x00000004;
      dailyActiveQuestIdList.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 daily_active_quest_id_list = 10;</code>
     * @param values the dailyActiveQuestIdList to add
     * @return this
     */
    public GetDailyActiveInfoScRsp addAllDailyActiveQuestIdList(final int... values) {
      bitField0_ |= 0x00000004;
      dailyActiveQuestIdList.addAll(values);
      return this;
    }

    /**
     * <code>repeated .DailyActivityInfo daily_active_level_list = 9;</code>
     * @return whether the dailyActiveLevelList field is set
     */
    public boolean hasDailyActiveLevelList() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>repeated .DailyActivityInfo daily_active_level_list = 9;</code>
     * @return this
     */
    public GetDailyActiveInfoScRsp clearDailyActiveLevelList() {
      bitField0_ &= ~0x00000008;
      dailyActiveLevelList.clear();
      return this;
    }

    /**
     * <code>repeated .DailyActivityInfo daily_active_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 #getMutableDailyActiveLevelList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<DailyActivityInfoOuterClass.DailyActivityInfo> getDailyActiveLevelList(
        ) {
      return dailyActiveLevelList;
    }

    /**
     * <code>repeated .DailyActivityInfo daily_active_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 RepeatedMessage<DailyActivityInfoOuterClass.DailyActivityInfo> getMutableDailyActiveLevelList(
        ) {
      bitField0_ |= 0x00000008;
      return dailyActiveLevelList;
    }

    /**
     * <code>repeated .DailyActivityInfo daily_active_level_list = 9;</code>
     * @param value the dailyActiveLevelList to add
     * @return this
     */
    public GetDailyActiveInfoScRsp addDailyActiveLevelList(
        final DailyActivityInfoOuterClass.DailyActivityInfo value) {
      bitField0_ |= 0x00000008;
      dailyActiveLevelList.add(value);
      return this;
    }

    /**
     * <code>repeated .DailyActivityInfo daily_active_level_list = 9;</code>
     * @param values the dailyActiveLevelList to add
     * @return this
     */
    public GetDailyActiveInfoScRsp addAllDailyActiveLevelList(
        final DailyActivityInfoOuterClass.DailyActivityInfo... values) {
      bitField0_ |= 0x00000008;
      dailyActiveLevelList.addAll(values);
      return this;
    }

    @Override
    public GetDailyActiveInfoScRsp copyFrom(final GetDailyActiveInfoScRsp other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        retcode = other.retcode;
        dailyActivePoint = other.dailyActivePoint;
        dailyActiveQuestIdList.copyFrom(other.dailyActiveQuestIdList);
        dailyActiveLevelList.copyFrom(other.dailyActiveLevelList);
      }
      return this;
    }

    @Override
    public GetDailyActiveInfoScRsp mergeFrom(final GetDailyActiveInfoScRsp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasRetcode()) {
        setRetcode(other.retcode);
      }
      if (other.hasDailyActivePoint()) {
        setDailyActivePoint(other.dailyActivePoint);
      }
      if (other.hasDailyActiveQuestIdList()) {
        getMutableDailyActiveQuestIdList().addAll(other.dailyActiveQuestIdList);
      }
      if (other.hasDailyActiveLevelList()) {
        getMutableDailyActiveLevelList().addAll(other.dailyActiveLevelList);
      }
      return this;
    }

    @Override
    public GetDailyActiveInfoScRsp clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      retcode = 0;
      dailyActivePoint = 0;
      dailyActiveQuestIdList.clear();
      dailyActiveLevelList.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof GetDailyActiveInfoScRsp)) {
        return false;
      }
      GetDailyActiveInfoScRsp other = (GetDailyActiveInfoScRsp) o;
      return bitField0_ == other.bitField0_
        && (!hasRetcode() || retcode == other.retcode)
        && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint)
        && (!hasDailyActiveQuestIdList() || dailyActiveQuestIdList.equals(other.dailyActiveQuestIdList))
        && (!hasDailyActiveLevelList() || dailyActiveLevelList.equals(other.dailyActiveLevelList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(retcode);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 112);
        output.writeUInt32NoTag(dailyActivePoint);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        for (int i = 0; i < dailyActiveQuestIdList.length(); i++) {
          output.writeRawByte((byte) 80);
          output.writeUInt32NoTag(dailyActiveQuestIdList.array()[i]);
        }
      }
      if ((bitField0_ & 0x00000008) != 0) {
        for (int i = 0; i < dailyActiveLevelList.length(); i++) {
          output.writeRawByte((byte) 74);
          output.writeMessageNoTag(dailyActiveLevelList.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += (1 * dailyActiveQuestIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(dailyActiveQuestIdList);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += (1 * dailyActiveLevelList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dailyActiveLevelList);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public GetDailyActiveInfoScRsp mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 16: {
            // retcode
            retcode = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // dailyActivePoint
            dailyActivePoint = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 82) {
              break;
            }
          }
          case 82: {
            // dailyActiveQuestIdList [packed=true]
            input.readPackedUInt32(dailyActiveQuestIdList, tag);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 74) {
              break;
            }
          }
          case 74: {
            // dailyActiveLevelList
            tag = input.readRepeatedMessage(dailyActiveLevelList, tag);
            bitField0_ |= 0x00000008;
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 80: {
            // dailyActiveQuestIdList [packed=false]
            tag = input.readRepeatedUInt32(dailyActiveQuestIdList, tag);
            bitField0_ |= 0x00000004;
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.retcode, retcode);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRepeatedUInt32(FieldNames.dailyActiveQuestIdList, dailyActiveQuestIdList);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRepeatedMessage(FieldNames.dailyActiveLevelList, dailyActiveLevelList);
      }
      output.endObject();
    }

    @Override
    public GetDailyActiveInfoScRsp mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 1097936398: {
            if (input.isAtField(FieldNames.retcode)) {
              if (!input.trySkipNullValue()) {
                retcode = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 859671121:
          case 1952864125: {
            if (input.isAtField(FieldNames.dailyActivePoint)) {
              if (!input.trySkipNullValue()) {
                dailyActivePoint = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1903124444:
          case -752691246: {
            if (input.isAtField(FieldNames.dailyActiveQuestIdList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(dailyActiveQuestIdList);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 705251971:
          case 1821477548: {
            if (input.isAtField(FieldNames.dailyActiveLevelList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(dailyActiveLevelList);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum GetDailyActiveInfoScRspFactory implements MessageFactory<GetDailyActiveInfoScRsp> {
      INSTANCE;

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

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

      static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point");

      static final FieldName dailyActiveQuestIdList = FieldName.forField("dailyActiveQuestIdList", "daily_active_quest_id_list");

      static final FieldName dailyActiveLevelList = FieldName.forField("dailyActiveLevelList", "daily_active_level_list");
    }
  }
}
