// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.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;
import us.hebi.quickbuf.RepeatedMessage;

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

    /**
     * <code>optional uint32 Id = 1;</code>
     */
    private int id;

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

    /**
     * <code>optional uint32 AupMissTimes = 3;</code>
     */
    private int aupMissTimes;

    /**
     * <code>optional uint32 AMissTimes = 4;</code>
     */
    private int aMissTimes;

    /**
     * <code>optional uint32 GachaTotalTimes = 13;</code>
     */
    private int gachaTotalTimes;

    /**
     * <code>optional uint32 TotalTimes = 14;</code>
     */
    private int totalTimes;

    /**
     * <code>optional uint32 AupGuaranteeTimes = 15;</code>
     */
    private int aupGuaranteeTimes;

    /**
     * <code>optional bool ReveFirstTenReward = 11;</code>
     */
    private boolean reveFirstTenReward;

    /**
     * <code>optional bool RecvGuaranteeReward = 12;</code>
     */
    private boolean recvGuaranteeReward;

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     */
    private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();

    private GachaInfo() {
    }

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

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return whether the id field is set
     */
    public boolean hasId() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return this
     */
    public GachaInfo clearId() {
      bitField0_ &= ~0x00000001;
      id = 0;
      return this;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return the id
     */
    public int getId() {
      return id;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @param value the id to set
     * @return this
     */
    public GachaInfo setId(final int value) {
      bitField0_ |= 0x00000001;
      id = value;
      return this;
    }

    /**
     * <code>optional uint32 DaysCount = 2;</code>
     * @return whether the daysCount field is set
     */
    public boolean hasDaysCount() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 DaysCount = 2;</code>
     * @return this
     */
    public GachaInfo clearDaysCount() {
      bitField0_ &= ~0x00000002;
      daysCount = 0;
      return this;
    }

    /**
     * <code>optional uint32 DaysCount = 2;</code>
     * @return the daysCount
     */
    public int getDaysCount() {
      return daysCount;
    }

    /**
     * <code>optional uint32 DaysCount = 2;</code>
     * @param value the daysCount to set
     * @return this
     */
    public GachaInfo setDaysCount(final int value) {
      bitField0_ |= 0x00000002;
      daysCount = value;
      return this;
    }

    /**
     * <code>optional uint32 AupMissTimes = 3;</code>
     * @return whether the aupMissTimes field is set
     */
    public boolean hasAupMissTimes() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional uint32 AupMissTimes = 3;</code>
     * @return this
     */
    public GachaInfo clearAupMissTimes() {
      bitField0_ &= ~0x00000004;
      aupMissTimes = 0;
      return this;
    }

    /**
     * <code>optional uint32 AupMissTimes = 3;</code>
     * @return the aupMissTimes
     */
    public int getAupMissTimes() {
      return aupMissTimes;
    }

    /**
     * <code>optional uint32 AupMissTimes = 3;</code>
     * @param value the aupMissTimes to set
     * @return this
     */
    public GachaInfo setAupMissTimes(final int value) {
      bitField0_ |= 0x00000004;
      aupMissTimes = value;
      return this;
    }

    /**
     * <code>optional uint32 AMissTimes = 4;</code>
     * @return whether the aMissTimes field is set
     */
    public boolean hasAMissTimes() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional uint32 AMissTimes = 4;</code>
     * @return this
     */
    public GachaInfo clearAMissTimes() {
      bitField0_ &= ~0x00000008;
      aMissTimes = 0;
      return this;
    }

    /**
     * <code>optional uint32 AMissTimes = 4;</code>
     * @return the aMissTimes
     */
    public int getAMissTimes() {
      return aMissTimes;
    }

    /**
     * <code>optional uint32 AMissTimes = 4;</code>
     * @param value the aMissTimes to set
     * @return this
     */
    public GachaInfo setAMissTimes(final int value) {
      bitField0_ |= 0x00000008;
      aMissTimes = value;
      return this;
    }

    /**
     * <code>optional uint32 GachaTotalTimes = 13;</code>
     * @return whether the gachaTotalTimes field is set
     */
    public boolean hasGachaTotalTimes() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional uint32 GachaTotalTimes = 13;</code>
     * @return this
     */
    public GachaInfo clearGachaTotalTimes() {
      bitField0_ &= ~0x00000010;
      gachaTotalTimes = 0;
      return this;
    }

    /**
     * <code>optional uint32 GachaTotalTimes = 13;</code>
     * @return the gachaTotalTimes
     */
    public int getGachaTotalTimes() {
      return gachaTotalTimes;
    }

    /**
     * <code>optional uint32 GachaTotalTimes = 13;</code>
     * @param value the gachaTotalTimes to set
     * @return this
     */
    public GachaInfo setGachaTotalTimes(final int value) {
      bitField0_ |= 0x00000010;
      gachaTotalTimes = value;
      return this;
    }

    /**
     * <code>optional uint32 TotalTimes = 14;</code>
     * @return whether the totalTimes field is set
     */
    public boolean hasTotalTimes() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional uint32 TotalTimes = 14;</code>
     * @return this
     */
    public GachaInfo clearTotalTimes() {
      bitField0_ &= ~0x00000020;
      totalTimes = 0;
      return this;
    }

    /**
     * <code>optional uint32 TotalTimes = 14;</code>
     * @return the totalTimes
     */
    public int getTotalTimes() {
      return totalTimes;
    }

    /**
     * <code>optional uint32 TotalTimes = 14;</code>
     * @param value the totalTimes to set
     * @return this
     */
    public GachaInfo setTotalTimes(final int value) {
      bitField0_ |= 0x00000020;
      totalTimes = value;
      return this;
    }

    /**
     * <code>optional uint32 AupGuaranteeTimes = 15;</code>
     * @return whether the aupGuaranteeTimes field is set
     */
    public boolean hasAupGuaranteeTimes() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional uint32 AupGuaranteeTimes = 15;</code>
     * @return this
     */
    public GachaInfo clearAupGuaranteeTimes() {
      bitField0_ &= ~0x00000040;
      aupGuaranteeTimes = 0;
      return this;
    }

    /**
     * <code>optional uint32 AupGuaranteeTimes = 15;</code>
     * @return the aupGuaranteeTimes
     */
    public int getAupGuaranteeTimes() {
      return aupGuaranteeTimes;
    }

    /**
     * <code>optional uint32 AupGuaranteeTimes = 15;</code>
     * @param value the aupGuaranteeTimes to set
     * @return this
     */
    public GachaInfo setAupGuaranteeTimes(final int value) {
      bitField0_ |= 0x00000040;
      aupGuaranteeTimes = value;
      return this;
    }

    /**
     * <code>optional bool ReveFirstTenReward = 11;</code>
     * @return whether the reveFirstTenReward field is set
     */
    public boolean hasReveFirstTenReward() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional bool ReveFirstTenReward = 11;</code>
     * @return this
     */
    public GachaInfo clearReveFirstTenReward() {
      bitField0_ &= ~0x00000080;
      reveFirstTenReward = false;
      return this;
    }

    /**
     * <code>optional bool ReveFirstTenReward = 11;</code>
     * @return the reveFirstTenReward
     */
    public boolean getReveFirstTenReward() {
      return reveFirstTenReward;
    }

    /**
     * <code>optional bool ReveFirstTenReward = 11;</code>
     * @param value the reveFirstTenReward to set
     * @return this
     */
    public GachaInfo setReveFirstTenReward(final boolean value) {
      bitField0_ |= 0x00000080;
      reveFirstTenReward = value;
      return this;
    }

    /**
     * <code>optional bool RecvGuaranteeReward = 12;</code>
     * @return whether the recvGuaranteeReward field is set
     */
    public boolean hasRecvGuaranteeReward() {
      return (bitField0_ & 0x00000100) != 0;
    }

    /**
     * <code>optional bool RecvGuaranteeReward = 12;</code>
     * @return this
     */
    public GachaInfo clearRecvGuaranteeReward() {
      bitField0_ &= ~0x00000100;
      recvGuaranteeReward = false;
      return this;
    }

    /**
     * <code>optional bool RecvGuaranteeReward = 12;</code>
     * @return the recvGuaranteeReward
     */
    public boolean getRecvGuaranteeReward() {
      return recvGuaranteeReward;
    }

    /**
     * <code>optional bool RecvGuaranteeReward = 12;</code>
     * @param value the recvGuaranteeReward to set
     * @return this
     */
    public GachaInfo setRecvGuaranteeReward(final boolean value) {
      bitField0_ |= 0x00000100;
      recvGuaranteeReward = value;
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return whether the nextPackage field is set
     */
    public boolean hasNextPackage() {
      return (bitField0_ & 0x00000200) != 0;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public GachaInfo clearNextPackage() {
      bitField0_ &= ~0x00000200;
      nextPackage.clear();
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</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 #getMutableNextPackage()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getNextPackage() {
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</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 getMutableNextPackage() {
      bitField0_ |= 0x00000200;
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param value the nextPackage to add
     * @return this
     */
    public GachaInfo addNextPackage(final byte value) {
      bitField0_ |= 0x00000200;
      nextPackage.add(value);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to add
     * @return this
     */
    public GachaInfo addAllNextPackage(final byte... values) {
      bitField0_ |= 0x00000200;
      nextPackage.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to set
     * @return this
     */
    public GachaInfo setNextPackage(final byte... values) {
      bitField0_ |= 0x00000200;
      nextPackage.copyFrom(values);
      return this;
    }

    @Override
    public GachaInfo copyFrom(final GachaInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        daysCount = other.daysCount;
        aupMissTimes = other.aupMissTimes;
        aMissTimes = other.aMissTimes;
        gachaTotalTimes = other.gachaTotalTimes;
        totalTimes = other.totalTimes;
        aupGuaranteeTimes = other.aupGuaranteeTimes;
        reveFirstTenReward = other.reveFirstTenReward;
        recvGuaranteeReward = other.recvGuaranteeReward;
        nextPackage.copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public GachaInfo mergeFrom(final GachaInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasDaysCount()) {
        setDaysCount(other.daysCount);
      }
      if (other.hasAupMissTimes()) {
        setAupMissTimes(other.aupMissTimes);
      }
      if (other.hasAMissTimes()) {
        setAMissTimes(other.aMissTimes);
      }
      if (other.hasGachaTotalTimes()) {
        setGachaTotalTimes(other.gachaTotalTimes);
      }
      if (other.hasTotalTimes()) {
        setTotalTimes(other.totalTimes);
      }
      if (other.hasAupGuaranteeTimes()) {
        setAupGuaranteeTimes(other.aupGuaranteeTimes);
      }
      if (other.hasReveFirstTenReward()) {
        setReveFirstTenReward(other.reveFirstTenReward);
      }
      if (other.hasRecvGuaranteeReward()) {
        setRecvGuaranteeReward(other.recvGuaranteeReward);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public GachaInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0;
      daysCount = 0;
      aupMissTimes = 0;
      aMissTimes = 0;
      gachaTotalTimes = 0;
      totalTimes = 0;
      aupGuaranteeTimes = 0;
      reveFirstTenReward = false;
      recvGuaranteeReward = false;
      nextPackage.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof GachaInfo)) {
        return false;
      }
      GachaInfo other = (GachaInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasDaysCount() || daysCount == other.daysCount)
        && (!hasAupMissTimes() || aupMissTimes == other.aupMissTimes)
        && (!hasAMissTimes() || aMissTimes == other.aMissTimes)
        && (!hasGachaTotalTimes() || gachaTotalTimes == other.gachaTotalTimes)
        && (!hasTotalTimes() || totalTimes == other.totalTimes)
        && (!hasAupGuaranteeTimes() || aupGuaranteeTimes == other.aupGuaranteeTimes)
        && (!hasReveFirstTenReward() || reveFirstTenReward == other.reveFirstTenReward)
        && (!hasRecvGuaranteeReward() || recvGuaranteeReward == other.recvGuaranteeReward)
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(daysCount);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 24);
        output.writeUInt32NoTag(aupMissTimes);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(aMissTimes);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 104);
        output.writeUInt32NoTag(gachaTotalTimes);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 112);
        output.writeUInt32NoTag(totalTimes);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 120);
        output.writeUInt32NoTag(aupGuaranteeTimes);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 88);
        output.writeBoolNoTag(reveFirstTenReward);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawByte((byte) 96);
        output.writeBoolNoTag(recvGuaranteeReward);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(daysCount);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(aupMissTimes);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(aMissTimes);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(gachaTotalTimes);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(totalTimes);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(aupGuaranteeTimes);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public GachaInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // id
            id = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 16) {
              break;
            }
          }
          case 16: {
            // daysCount
            daysCount = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // aupMissTimes
            aupMissTimes = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // aMissTimes
            aMissTimes = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 104) {
              break;
            }
          }
          case 104: {
            // gachaTotalTimes
            gachaTotalTimes = input.readUInt32();
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // totalTimes
            totalTimes = input.readUInt32();
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 120) {
              break;
            }
          }
          case 120: {
            // aupGuaranteeTimes
            aupGuaranteeTimes = input.readUInt32();
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 88) {
              break;
            }
          }
          case 88: {
            // reveFirstTenReward
            reveFirstTenReward = input.readBool();
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 96) {
              break;
            }
          }
          case 96: {
            // recvGuaranteeReward
            recvGuaranteeReward = input.readBool();
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000200;
            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.id, id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.daysCount, daysCount);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.aupMissTimes, aupMissTimes);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.aMissTimes, aMissTimes);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeUInt32(FieldNames.gachaTotalTimes, gachaTotalTimes);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeUInt32(FieldNames.totalTimes, totalTimes);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeUInt32(FieldNames.aupGuaranteeTimes, aupGuaranteeTimes);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeBool(FieldNames.reveFirstTenReward, reveFirstTenReward);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeBool(FieldNames.recvGuaranteeReward, recvGuaranteeReward);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      output.endObject();
    }

    @Override
    public GachaInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 2363: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2022494504: {
            if (input.isAtField(FieldNames.daysCount)) {
              if (!input.trySkipNullValue()) {
                daysCount = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1590821778: {
            if (input.isAtField(FieldNames.aupMissTimes)) {
              if (!input.trySkipNullValue()) {
                aupMissTimes = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -955152279: {
            if (input.isAtField(FieldNames.aMissTimes)) {
              if (!input.trySkipNullValue()) {
                aMissTimes = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1802973852: {
            if (input.isAtField(FieldNames.gachaTotalTimes)) {
              if (!input.trySkipNullValue()) {
                gachaTotalTimes = input.readUInt32();
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1277592194: {
            if (input.isAtField(FieldNames.totalTimes)) {
              if (!input.trySkipNullValue()) {
                totalTimes = input.readUInt32();
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1466287270: {
            if (input.isAtField(FieldNames.aupGuaranteeTimes)) {
              if (!input.trySkipNullValue()) {
                aupGuaranteeTimes = input.readUInt32();
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1124399682: {
            if (input.isAtField(FieldNames.reveFirstTenReward)) {
              if (!input.trySkipNullValue()) {
                reveFirstTenReward = input.readBool();
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1985982223: {
            if (input.isAtField(FieldNames.recvGuaranteeReward)) {
              if (!input.trySkipNullValue()) {
                recvGuaranteeReward = input.readBool();
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum GachaInfoFactory implements MessageFactory<GachaInfo> {
      INSTANCE;

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

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

      static final FieldName daysCount = FieldName.forField("DaysCount");

      static final FieldName aupMissTimes = FieldName.forField("AupMissTimes");

      static final FieldName aMissTimes = FieldName.forField("AMissTimes");

      static final FieldName gachaTotalTimes = FieldName.forField("GachaTotalTimes");

      static final FieldName totalTimes = FieldName.forField("TotalTimes");

      static final FieldName aupGuaranteeTimes = FieldName.forField("AupGuaranteeTimes");

      static final FieldName reveFirstTenReward = FieldName.forField("ReveFirstTenReward");

      static final FieldName recvGuaranteeReward = FieldName.forField("RecvGuaranteeReward");

      static final FieldName nextPackage = FieldName.forField("NextPackage");
    }
  }

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

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     */
    private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();

    /**
     * <code>repeated .GachaInfo Information = 1;</code>
     */
    private final RepeatedMessage<GachaInfo> information = RepeatedMessage.newEmptyInstance(GachaInfo.getFactory());

    private GachaInformationResp() {
    }

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

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return whether the nextPackage field is set
     */
    public boolean hasNextPackage() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public GachaInformationResp clearNextPackage() {
      bitField0_ &= ~0x00000001;
      nextPackage.clear();
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</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 #getMutableNextPackage()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getNextPackage() {
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</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 getMutableNextPackage() {
      bitField0_ |= 0x00000001;
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param value the nextPackage to add
     * @return this
     */
    public GachaInformationResp addNextPackage(final byte value) {
      bitField0_ |= 0x00000001;
      nextPackage.add(value);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to add
     * @return this
     */
    public GachaInformationResp addAllNextPackage(final byte... values) {
      bitField0_ |= 0x00000001;
      nextPackage.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to set
     * @return this
     */
    public GachaInformationResp setNextPackage(final byte... values) {
      bitField0_ |= 0x00000001;
      nextPackage.copyFrom(values);
      return this;
    }

    /**
     * <code>repeated .GachaInfo Information = 1;</code>
     * @return whether the information field is set
     */
    public boolean hasInformation() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>repeated .GachaInfo Information = 1;</code>
     * @return this
     */
    public GachaInformationResp clearInformation() {
      bitField0_ &= ~0x00000002;
      information.clear();
      return this;
    }

    /**
     * <code>repeated .GachaInfo Information = 1;</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 #getMutableInformation()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<GachaInfo> getInformation() {
      return information;
    }

    /**
     * <code>repeated .GachaInfo Information = 1;</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<GachaInfo> getMutableInformation() {
      bitField0_ |= 0x00000002;
      return information;
    }

    /**
     * <code>repeated .GachaInfo Information = 1;</code>
     * @param value the information to add
     * @return this
     */
    public GachaInformationResp addInformation(final GachaInfo value) {
      bitField0_ |= 0x00000002;
      information.add(value);
      return this;
    }

    /**
     * <code>repeated .GachaInfo Information = 1;</code>
     * @param values the information to add
     * @return this
     */
    public GachaInformationResp addAllInformation(final GachaInfo... values) {
      bitField0_ |= 0x00000002;
      information.addAll(values);
      return this;
    }

    @Override
    public GachaInformationResp copyFrom(final GachaInformationResp other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        nextPackage.copyFrom(other.nextPackage);
        information.copyFrom(other.information);
      }
      return this;
    }

    @Override
    public GachaInformationResp mergeFrom(final GachaInformationResp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasInformation()) {
        getMutableInformation().addAll(other.information);
      }
      return this;
    }

    @Override
    public GachaInformationResp clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      information.clear();
      return this;
    }

    @Override
    public GachaInformationResp clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      information.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof GachaInformationResp)) {
        return false;
      }
      GachaInformationResp other = (GachaInformationResp) o;
      return bitField0_ == other.bitField0_
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasInformation() || information.equals(other.information));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        for (int i = 0; i < information.length(); i++) {
          output.writeRawByte((byte) 10);
          output.writeMessageNoTag(information.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += (1 * information.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(information);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public GachaInformationResp mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 10) {
              break;
            }
          }
          case 10: {
            // information
            tag = input.readRepeatedMessage(information, tag);
            bitField0_ |= 0x00000002;
            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.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRepeatedMessage(FieldNames.information, information);
      }
      output.endObject();
    }

    @Override
    public GachaInformationResp mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -658498292: {
            if (input.isAtField(FieldNames.information)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(information);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum GachaInformationRespFactory implements MessageFactory<GachaInformationResp> {
      INSTANCE;

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

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

      static final FieldName information = FieldName.forField("Information");
    }
  }
}
