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

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

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

    private PickItemReq() {
    }

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

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

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

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

    /**
     * <code>repeated .PickItem 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<ItemUse.PickItem> getList() {
      return list;
    }

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

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

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

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

    @Override
    public PickItemReq mergeFrom(final PickItemReq 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 PickItemReq clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      list.clear();
      return this;
    }

    @Override
    public PickItemReq 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 PickItemReq)) {
        return false;
      }
      PickItemReq other = (PickItemReq) 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 PickItemReq 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 PickItemReq 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 PickItemReq clone() {
      return new PickItemReq().copyFrom(this);
    }

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

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

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

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

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

    private enum PickItemReqFactory implements MessageFactory<PickItemReq> {
      INSTANCE;

      @Override
      public PickItemReq create() {
        return PickItemReq.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");
    }
  }

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

    /**
     * <code>optional .ItemProductReq Product = 1;</code>
     */
    private final ItemProduct.ItemProductReq product = ItemProduct.ItemProductReq.newInstance();

    /**
     * <code>optional .PickItemReq Pick = 2;</code>
     */
    private final PickItemReq pick = PickItemReq.newInstance();

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

    private GrowthStep() {
    }

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

    /**
     * <code>optional .ItemProductReq Product = 1;</code>
     * @return whether the product field is set
     */
    public boolean hasProduct() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional .ItemProductReq Product = 1;</code>
     * @return this
     */
    public GrowthStep clearProduct() {
      bitField0_ &= ~0x00000001;
      product.clear();
      return this;
    }

    /**
     * <code>optional .ItemProductReq Product = 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 #getMutableProduct()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public ItemProduct.ItemProductReq getProduct() {
      return product;
    }

    /**
     * <code>optional .ItemProductReq Product = 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 ItemProduct.ItemProductReq getMutableProduct() {
      bitField0_ |= 0x00000001;
      return product;
    }

    /**
     * <code>optional .ItemProductReq Product = 1;</code>
     * @param value the product to set
     * @return this
     */
    public GrowthStep setProduct(final ItemProduct.ItemProductReq value) {
      bitField0_ |= 0x00000001;
      product.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .PickItemReq Pick = 2;</code>
     * @return whether the pick field is set
     */
    public boolean hasPick() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .PickItemReq Pick = 2;</code>
     * @return this
     */
    public GrowthStep clearPick() {
      bitField0_ &= ~0x00000002;
      pick.clear();
      return this;
    }

    /**
     * <code>optional .PickItemReq Pick = 2;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutablePick()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PickItemReq getPick() {
      return pick;
    }

    /**
     * <code>optional .PickItemReq Pick = 2;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public PickItemReq getMutablePick() {
      bitField0_ |= 0x00000002;
      return pick;
    }

    /**
     * <code>optional .PickItemReq Pick = 2;</code>
     * @param value the pick to set
     * @return this
     */
    public GrowthStep setPick(final PickItemReq value) {
      bitField0_ |= 0x00000002;
      pick.copyFrom(value);
      return this;
    }

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

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

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

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

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

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

    @Override
    public GrowthStep mergeFrom(final GrowthStep other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasProduct()) {
        getMutableProduct().mergeFrom(other.product);
      }
      if (other.hasPick()) {
        getMutablePick().mergeFrom(other.pick);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      return this;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof GrowthStep)) {
        return false;
      }
      GrowthStep other = (GrowthStep) o;
      return bitField0_ == other.bitField0_
        && (!hasProduct() || product.equals(other.product))
        && (!hasPick() || pick.equals(other.pick))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 10);
        output.writeMessageNoTag(product);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 18);
        output.writeMessageNoTag(pick);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(product);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(pick);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public GrowthStep mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 10: {
            // product
            input.readMessage(product);
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // pick
            input.readMessage(pick);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeMessage(FieldNames.product, product);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeMessage(FieldNames.pick, pick);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      output.endObject();
    }

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

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

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

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

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

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

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

    private enum GrowthStepFactory implements MessageFactory<GrowthStep> {
      INSTANCE;

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

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

      static final FieldName pick = FieldName.forField("Pick");

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

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

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

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

    private ItemGrowthReq() {
    }

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

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

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

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

    /**
     * <code>repeated .GrowthStep 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<GrowthStep> getList() {
      return list;
    }

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

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

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

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

    @Override
    public ItemGrowthReq mergeFrom(final ItemGrowthReq 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 ItemGrowthReq clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      list.clear();
      return this;
    }

    @Override
    public ItemGrowthReq 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 ItemGrowthReq)) {
        return false;
      }
      ItemGrowthReq other = (ItemGrowthReq) 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 ItemGrowthReq 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 ItemGrowthReq 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 ItemGrowthReq clone() {
      return new ItemGrowthReq().copyFrom(this);
    }

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

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

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

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

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

    private enum ItemGrowthReqFactory implements MessageFactory<ItemGrowthReq> {
      INSTANCE;

      @Override
      public ItemGrowthReq create() {
        return ItemGrowthReq.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");
    }
  }
}
