// 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.RepeatedInt;
import us.hebi.quickbuf.RepeatedMessage;

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

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

    /**
     * <code>repeated uint32 Values = 1;</code>
     */
    private final RepeatedInt values_ = RepeatedInt.newEmptyInstance();

    private UI32s() {
    }

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

    /**
     * <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 UI32s 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 UI32s 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 UI32s 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 UI32s setNextPackage(final byte... values) {
      bitField0_ |= 0x00000001;
      nextPackage.copyFrom(values);
      return this;
    }

    /**
     * <code>repeated uint32 Values = 1;</code>
     * @return whether the values_ field is set
     */
    public boolean hasValues() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>repeated uint32 Values = 1;</code>
     * @return this
     */
    public UI32s clearValues() {
      bitField0_ &= ~0x00000002;
      values_.clear();
      return this;
    }

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

    /**
     * <code>repeated uint32 Values = 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 RepeatedInt getMutableValues() {
      bitField0_ |= 0x00000002;
      return values_;
    }

    /**
     * <code>repeated uint32 Values = 1;</code>
     * @param value the values_ to add
     * @return this
     */
    public UI32s addValues(final int value) {
      bitField0_ |= 0x00000002;
      values_.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 Values = 1;</code>
     * @param values the values_ to add
     * @return this
     */
    public UI32s addAllValues(final int... values) {
      bitField0_ |= 0x00000002;
      values_.addAll(values);
      return this;
    }

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

    @Override
    public UI32s mergeFrom(final UI32s other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasValues()) {
        getMutableValues().addAll(other.values_);
      }
      return this;
    }

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

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

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

    @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 < values_.length(); i++) {
          output.writeRawByte((byte) 8);
          output.writeUInt32NoTag(values_.array()[i]);
        }
      }
    }

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

    @Override
    @SuppressWarnings("fallthrough")
    public UI32s 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: {
            // values_ [packed=true]
            input.readPackedUInt32(values_, tag);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 8: {
            // values_ [packed=false]
            tag = input.readRepeatedUInt32(values_, tag);
            bitField0_ |= 0x00000002;
            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.writeRepeatedUInt32(FieldNames.values_, values_);
      }
      output.endObject();
    }

    @Override
    public UI32s 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 -1739945662: {
            if (input.isAtField(FieldNames.values_)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(values_);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum UI32sFactory implements MessageFactory<UI32s> {
      INSTANCE;

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

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

      static final FieldName values_ = FieldName.forField("Values");
    }
  }

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

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

    /**
     * <code>optional uint32 Times = 3;</code>
     */
    private int times;

    /**
     * <code>optional bool Receive = 2;</code>
     */
    private boolean receive;

    /**
     * <code>optional .UI32s Temp = 15;</code>
     */
    private final UI32s temp = UI32s.newInstance();

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

    /**
     * <code>repeated .UI32s Cards = 14;</code>
     */
    private final RepeatedMessage<UI32s> cards = RepeatedMessage.newEmptyInstance(UI32s.getFactory());

    private GachaNewbieInfo() {
    }

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

    /**
     * <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 GachaNewbieInfo 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 GachaNewbieInfo setId(final int value) {
      bitField0_ |= 0x00000001;
      id = value;
      return this;
    }

    /**
     * <code>optional uint32 Times = 3;</code>
     * @return whether the times field is set
     */
    public boolean hasTimes() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 Times = 3;</code>
     * @return this
     */
    public GachaNewbieInfo clearTimes() {
      bitField0_ &= ~0x00000002;
      times = 0;
      return this;
    }

    /**
     * <code>optional uint32 Times = 3;</code>
     * @return the times
     */
    public int getTimes() {
      return times;
    }

    /**
     * <code>optional uint32 Times = 3;</code>
     * @param value the times to set
     * @return this
     */
    public GachaNewbieInfo setTimes(final int value) {
      bitField0_ |= 0x00000002;
      times = value;
      return this;
    }

    /**
     * <code>optional bool Receive = 2;</code>
     * @return whether the receive field is set
     */
    public boolean hasReceive() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional bool Receive = 2;</code>
     * @return this
     */
    public GachaNewbieInfo clearReceive() {
      bitField0_ &= ~0x00000004;
      receive = false;
      return this;
    }

    /**
     * <code>optional bool Receive = 2;</code>
     * @return the receive
     */
    public boolean getReceive() {
      return receive;
    }

    /**
     * <code>optional bool Receive = 2;</code>
     * @param value the receive to set
     * @return this
     */
    public GachaNewbieInfo setReceive(final boolean value) {
      bitField0_ |= 0x00000004;
      receive = value;
      return this;
    }

    /**
     * <code>optional .UI32s Temp = 15;</code>
     * @return whether the temp field is set
     */
    public boolean hasTemp() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional .UI32s Temp = 15;</code>
     * @return this
     */
    public GachaNewbieInfo clearTemp() {
      bitField0_ &= ~0x00000008;
      temp.clear();
      return this;
    }

    /**
     * <code>optional .UI32s Temp = 15;</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 #getMutableTemp()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public UI32s getTemp() {
      return temp;
    }

    /**
     * <code>optional .UI32s Temp = 15;</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 UI32s getMutableTemp() {
      bitField0_ |= 0x00000008;
      return temp;
    }

    /**
     * <code>optional .UI32s Temp = 15;</code>
     * @param value the temp to set
     * @return this
     */
    public GachaNewbieInfo setTemp(final UI32s value) {
      bitField0_ |= 0x00000008;
      temp.copyFrom(value);
      return this;
    }

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

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public GachaNewbieInfo clearNextPackage() {
      bitField0_ &= ~0x00000010;
      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_ |= 0x00000010;
      return nextPackage;
    }

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

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

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

    /**
     * <code>repeated .UI32s Cards = 14;</code>
     * @return whether the cards field is set
     */
    public boolean hasCards() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>repeated .UI32s Cards = 14;</code>
     * @return this
     */
    public GachaNewbieInfo clearCards() {
      bitField0_ &= ~0x00000020;
      cards.clear();
      return this;
    }

    /**
     * <code>repeated .UI32s Cards = 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 #getMutableCards()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<UI32s> getCards() {
      return cards;
    }

    /**
     * <code>repeated .UI32s Cards = 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 RepeatedMessage<UI32s> getMutableCards() {
      bitField0_ |= 0x00000020;
      return cards;
    }

    /**
     * <code>repeated .UI32s Cards = 14;</code>
     * @param value the cards to add
     * @return this
     */
    public GachaNewbieInfo addCards(final UI32s value) {
      bitField0_ |= 0x00000020;
      cards.add(value);
      return this;
    }

    /**
     * <code>repeated .UI32s Cards = 14;</code>
     * @param values the cards to add
     * @return this
     */
    public GachaNewbieInfo addAllCards(final UI32s... values) {
      bitField0_ |= 0x00000020;
      cards.addAll(values);
      return this;
    }

    @Override
    public GachaNewbieInfo copyFrom(final GachaNewbieInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        times = other.times;
        receive = other.receive;
        temp.copyFrom(other.temp);
        nextPackage.copyFrom(other.nextPackage);
        cards.copyFrom(other.cards);
      }
      return this;
    }

    @Override
    public GachaNewbieInfo mergeFrom(final GachaNewbieInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasTimes()) {
        setTimes(other.times);
      }
      if (other.hasReceive()) {
        setReceive(other.receive);
      }
      if (other.hasTemp()) {
        getMutableTemp().mergeFrom(other.temp);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasCards()) {
        getMutableCards().addAll(other.cards);
      }
      return this;
    }

    @Override
    public GachaNewbieInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0;
      times = 0;
      receive = false;
      temp.clear();
      nextPackage.clear();
      cards.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof GachaNewbieInfo)) {
        return false;
      }
      GachaNewbieInfo other = (GachaNewbieInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasTimes() || times == other.times)
        && (!hasReceive() || receive == other.receive)
        && (!hasTemp() || temp.equals(other.temp))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasCards() || cards.equals(other.cards));
    }

    @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) 24);
        output.writeUInt32NoTag(times);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 16);
        output.writeBoolNoTag(receive);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 122);
        output.writeMessageNoTag(temp);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        for (int i = 0; i < cards.length(); i++) {
          output.writeRawByte((byte) 114);
          output.writeMessageNoTag(cards.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(times);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(temp);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += (1 * cards.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(cards);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public GachaNewbieInfo 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 != 24) {
              break;
            }
          }
          case 24: {
            // times
            times = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 16) {
              break;
            }
          }
          case 16: {
            // receive
            receive = input.readBool();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // temp
            input.readMessage(temp);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 114) {
              break;
            }
          }
          case 114: {
            // cards
            tag = input.readRepeatedMessage(cards, tag);
            bitField0_ |= 0x00000020;
            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.times, times);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeBool(FieldNames.receive, receive);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeMessage(FieldNames.temp, temp);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRepeatedMessage(FieldNames.cards, cards);
      }
      output.endObject();
    }

    @Override
    public GachaNewbieInfo 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 80811814: {
            if (input.isAtField(FieldNames.times)) {
              if (!input.trySkipNullValue()) {
                times = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1548023101: {
            if (input.isAtField(FieldNames.receive)) {
              if (!input.trySkipNullValue()) {
                receive = input.readBool();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2602996: {
            if (input.isAtField(FieldNames.temp)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(temp);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 64878403: {
            if (input.isAtField(FieldNames.cards)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(cards);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum GachaNewbieInfoFactory implements MessageFactory<GachaNewbieInfo> {
      INSTANCE;

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

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

      static final FieldName times = FieldName.forField("Times");

      static final FieldName receive = FieldName.forField("Receive");

      static final FieldName temp = FieldName.forField("Temp");

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

      static final FieldName cards = FieldName.forField("Cards");
    }
  }

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

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

    /**
     * <code>repeated .GachaNewbieInfo List = 1;</code>
     */
    private final RepeatedMessage<GachaNewbieInfo> list = RepeatedMessage.newEmptyInstance(GachaNewbieInfo.getFactory());

    private GachaNewbieInfoResp() {
    }

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

    /**
     * <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 GachaNewbieInfoResp 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 GachaNewbieInfoResp 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 GachaNewbieInfoResp 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 GachaNewbieInfoResp setNextPackage(final byte... values) {
      bitField0_ |= 0x00000001;
      nextPackage.copyFrom(values);
      return this;
    }

    /**
     * <code>repeated .GachaNewbieInfo List = 1;</code>
     * @return whether the list field is set
     */
    public boolean hasList() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>repeated .GachaNewbieInfo List = 1;</code>
     * @return this
     */
    public GachaNewbieInfoResp clearList() {
      bitField0_ &= ~0x00000002;
      list.clear();
      return this;
    }

    /**
     * <code>repeated .GachaNewbieInfo List = 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 #getMutableList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<GachaNewbieInfo> getList() {
      return list;
    }

    /**
     * <code>repeated .GachaNewbieInfo List = 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<GachaNewbieInfo> getMutableList() {
      bitField0_ |= 0x00000002;
      return list;
    }

    /**
     * <code>repeated .GachaNewbieInfo List = 1;</code>
     * @param value the list to add
     * @return this
     */
    public GachaNewbieInfoResp addList(final GachaNewbieInfo value) {
      bitField0_ |= 0x00000002;
      list.add(value);
      return this;
    }

    /**
     * <code>repeated .GachaNewbieInfo List = 1;</code>
     * @param values the list to add
     * @return this
     */
    public GachaNewbieInfoResp addAllList(final GachaNewbieInfo... values) {
      bitField0_ |= 0x00000002;
      list.addAll(values);
      return this;
    }

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

    @Override
    public GachaNewbieInfoResp mergeFrom(final GachaNewbieInfoResp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasList()) {
        getMutableList().addAll(other.list);
      }
      return this;
    }

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

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

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

    @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 < list.length(); i++) {
          output.writeRawByte((byte) 10);
          output.writeMessageNoTag(list.get(i));
        }
      }
    }

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

    @Override
    @SuppressWarnings("fallthrough")
    public GachaNewbieInfoResp 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: {
            // list
            tag = input.readRepeatedMessage(list, 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.list, list);
      }
      output.endObject();
    }

    @Override
    public GachaNewbieInfoResp 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 2368702: {
            if (input.isAtField(FieldNames.list)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(list);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum GachaNewbieInfoRespFactory implements MessageFactory<GachaNewbieInfoResp> {
      INSTANCE;

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

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

      static final FieldName list = FieldName.forField("List");
    }
  }
}
