// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;

import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.ProtoUtil;
import us.hebi.quickbuf.RepeatedInt;
import us.hebi.quickbuf.RepeatedMessage;
import us.hebi.quickbuf.Utf8String;

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

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

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

    /**
     * <code>optional uint32 owner_id = 3;</code>
     */
    private int ownerId;

    /**
     * <code>optional uint32 wave_flag = 4;</code>
     */
    private int waveFlag;

    /**
     * <code>repeated uint32 target_index_list = 5;</code>
     */
    private final RepeatedInt targetIndexList = RepeatedInt.newEmptyInstance();

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</code>
     */
    private final RepeatedMessage<DynamicValuesEntry> dynamicValues = RepeatedMessage.newEmptyInstance(DynamicValuesEntry.getFactory());

    private BattleBuff() {
    }

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

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

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

    /**
     * <code>optional uint32 level = 2;</code>
     * @return this
     */
    public BattleBuff clearLevel() {
      bitField0_ &= ~0x00000002;
      level = 0;
      return this;
    }

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

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

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

    /**
     * <code>optional uint32 owner_id = 3;</code>
     * @return this
     */
    public BattleBuff clearOwnerId() {
      bitField0_ &= ~0x00000004;
      ownerId = 0;
      return this;
    }

    /**
     * <code>optional uint32 owner_id = 3;</code>
     * @return the ownerId
     */
    public int getOwnerId() {
      return ownerId;
    }

    /**
     * <code>optional uint32 owner_id = 3;</code>
     * @param value the ownerId to set
     * @return this
     */
    public BattleBuff setOwnerId(final int value) {
      bitField0_ |= 0x00000004;
      ownerId = value;
      return this;
    }

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

    /**
     * <code>optional uint32 wave_flag = 4;</code>
     * @return this
     */
    public BattleBuff clearWaveFlag() {
      bitField0_ &= ~0x00000008;
      waveFlag = 0;
      return this;
    }

    /**
     * <code>optional uint32 wave_flag = 4;</code>
     * @return the waveFlag
     */
    public int getWaveFlag() {
      return waveFlag;
    }

    /**
     * <code>optional uint32 wave_flag = 4;</code>
     * @param value the waveFlag to set
     * @return this
     */
    public BattleBuff setWaveFlag(final int value) {
      bitField0_ |= 0x00000008;
      waveFlag = value;
      return this;
    }

    /**
     * <code>repeated uint32 target_index_list = 5;</code>
     * @return whether the targetIndexList field is set
     */
    public boolean hasTargetIndexList() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>repeated uint32 target_index_list = 5;</code>
     * @return this
     */
    public BattleBuff clearTargetIndexList() {
      bitField0_ &= ~0x00000010;
      targetIndexList.clear();
      return this;
    }

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

    /**
     * <code>repeated uint32 target_index_list = 5;</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 getMutableTargetIndexList() {
      bitField0_ |= 0x00000010;
      return targetIndexList;
    }

    /**
     * <code>repeated uint32 target_index_list = 5;</code>
     * @param value the targetIndexList to add
     * @return this
     */
    public BattleBuff addTargetIndexList(final int value) {
      bitField0_ |= 0x00000010;
      targetIndexList.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 target_index_list = 5;</code>
     * @param values the targetIndexList to add
     * @return this
     */
    public BattleBuff addAllTargetIndexList(final int... values) {
      bitField0_ |= 0x00000010;
      targetIndexList.addAll(values);
      return this;
    }

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</code>
     * @return whether the dynamicValues field is set
     */
    public boolean hasDynamicValues() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</code>
     * @return this
     */
    public BattleBuff clearDynamicValues() {
      bitField0_ &= ~0x00000020;
      dynamicValues.clear();
      return this;
    }

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</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 #getMutableDynamicValues()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<DynamicValuesEntry> getDynamicValues() {
      return dynamicValues;
    }

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</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<DynamicValuesEntry> getMutableDynamicValues() {
      bitField0_ |= 0x00000020;
      return dynamicValues;
    }

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</code>
     * @param value the dynamicValues to add
     * @return this
     */
    public BattleBuff addDynamicValues(final DynamicValuesEntry value) {
      bitField0_ |= 0x00000020;
      dynamicValues.add(value);
      return this;
    }

    /**
     * <code>repeated .BattleBuff.DynamicValuesEntry dynamic_values = 6;</code>
     * @param values the dynamicValues to add
     * @return this
     */
    public BattleBuff addAllDynamicValues(final DynamicValuesEntry... values) {
      bitField0_ |= 0x00000020;
      dynamicValues.addAll(values);
      return this;
    }

    @Override
    public BattleBuff copyFrom(final BattleBuff other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        level = other.level;
        ownerId = other.ownerId;
        waveFlag = other.waveFlag;
        targetIndexList.copyFrom(other.targetIndexList);
        dynamicValues.copyFrom(other.dynamicValues);
      }
      return this;
    }

    @Override
    public BattleBuff mergeFrom(final BattleBuff other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasLevel()) {
        setLevel(other.level);
      }
      if (other.hasOwnerId()) {
        setOwnerId(other.ownerId);
      }
      if (other.hasWaveFlag()) {
        setWaveFlag(other.waveFlag);
      }
      if (other.hasTargetIndexList()) {
        getMutableTargetIndexList().addAll(other.targetIndexList);
      }
      if (other.hasDynamicValues()) {
        getMutableDynamicValues().addAll(other.dynamicValues);
      }
      return this;
    }

    @Override
    public BattleBuff clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0;
      level = 0;
      ownerId = 0;
      waveFlag = 0;
      targetIndexList.clear();
      dynamicValues.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof BattleBuff)) {
        return false;
      }
      BattleBuff other = (BattleBuff) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasLevel() || level == other.level)
        && (!hasOwnerId() || ownerId == other.ownerId)
        && (!hasWaveFlag() || waveFlag == other.waveFlag)
        && (!hasTargetIndexList() || targetIndexList.equals(other.targetIndexList))
        && (!hasDynamicValues() || dynamicValues.equals(other.dynamicValues));
    }

    @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(level);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 24);
        output.writeUInt32NoTag(ownerId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(waveFlag);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        for (int i = 0; i < targetIndexList.length(); i++) {
          output.writeRawByte((byte) 40);
          output.writeUInt32NoTag(targetIndexList.array()[i]);
        }
      }
      if ((bitField0_ & 0x00000020) != 0) {
        for (int i = 0; i < dynamicValues.length(); i++) {
          output.writeRawByte((byte) 50);
          output.writeMessageNoTag(dynamicValues.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(level);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(ownerId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(waveFlag);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += (1 * targetIndexList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(targetIndexList);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += (1 * dynamicValues.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dynamicValues);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public BattleBuff 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: {
            // level
            level = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // ownerId
            ownerId = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // waveFlag
            waveFlag = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 42) {
              break;
            }
          }
          case 42: {
            // targetIndexList [packed=true]
            input.readPackedUInt32(targetIndexList, tag);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // dynamicValues
            tag = input.readRepeatedMessage(dynamicValues, tag);
            bitField0_ |= 0x00000020;
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 40: {
            // targetIndexList [packed=false]
            tag = input.readRepeatedUInt32(targetIndexList, tag);
            bitField0_ |= 0x00000010;
            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.level, level);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.ownerId, ownerId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.waveFlag, waveFlag);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRepeatedUInt32(FieldNames.targetIndexList, targetIndexList);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRepeatedMessage(FieldNames.dynamicValues, dynamicValues);
      }
      output.endObject();
    }

    @Override
    public BattleBuff mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3355: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 102865796: {
            if (input.isAtField(FieldNames.level)) {
              if (!input.trySkipNullValue()) {
                level = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1054729426:
          case 1663147559: {
            if (input.isAtField(FieldNames.ownerId)) {
              if (!input.trySkipNullValue()) {
                ownerId = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 603251205:
          case 1543837938: {
            if (input.isAtField(FieldNames.waveFlag)) {
              if (!input.trySkipNullValue()) {
                waveFlag = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1377203711:
          case -322772135: {
            if (input.isAtField(FieldNames.targetIndexList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(targetIndexList);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 571506241:
          case 525223202: {
            if (input.isAtField(FieldNames.dynamicValues)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(dynamicValues);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

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

      /**
       * <code>optional float value = 2;</code>
       */
      private float value_;

      /**
       * <code>optional string key = 1;</code>
       */
      private final Utf8String key = Utf8String.newEmptyInstance();

      private DynamicValuesEntry() {
      }

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

      /**
       * <code>optional float value = 2;</code>
       * @return whether the value_ field is set
       */
      public boolean hasValue() {
        return (bitField0_ & 0x00000001) != 0;
      }

      /**
       * <code>optional float value = 2;</code>
       * @return this
       */
      public DynamicValuesEntry clearValue() {
        bitField0_ &= ~0x00000001;
        value_ = 0F;
        return this;
      }

      /**
       * <code>optional float value = 2;</code>
       * @return the value_
       */
      public float getValue() {
        return value_;
      }

      /**
       * <code>optional float value = 2;</code>
       * @param value the value_ to set
       * @return this
       */
      public DynamicValuesEntry setValue(final float value) {
        bitField0_ |= 0x00000001;
        value_ = value;
        return this;
      }

      /**
       * <code>optional string key = 1;</code>
       * @return whether the key field is set
       */
      public boolean hasKey() {
        return (bitField0_ & 0x00000002) != 0;
      }

      /**
       * <code>optional string key = 1;</code>
       * @return this
       */
      public DynamicValuesEntry clearKey() {
        bitField0_ &= ~0x00000002;
        key.clear();
        return this;
      }

      /**
       * <code>optional string key = 1;</code>
       * @return the key
       */
      public String getKey() {
        return key.getString();
      }

      /**
       * <code>optional string key = 1;</code>
       * @return internal {@code Utf8String} representation of key for reading
       */
      public Utf8String getKeyBytes() {
        return this.key;
      }

      /**
       * <code>optional string key = 1;</code>
       * @return internal {@code Utf8String} representation of key for modifications
       */
      public Utf8String getMutableKeyBytes() {
        bitField0_ |= 0x00000002;
        return this.key;
      }

      /**
       * <code>optional string key = 1;</code>
       * @param value the key to set
       * @return this
       */
      public DynamicValuesEntry setKey(final CharSequence value) {
        bitField0_ |= 0x00000002;
        key.copyFrom(value);
        return this;
      }

      /**
       * <code>optional string key = 1;</code>
       * @param value the key to set
       * @return this
       */
      public DynamicValuesEntry setKey(final Utf8String value) {
        bitField0_ |= 0x00000002;
        key.copyFrom(value);
        return this;
      }

      @Override
      public DynamicValuesEntry copyFrom(final DynamicValuesEntry other) {
        cachedSize = other.cachedSize;
        if ((bitField0_ | other.bitField0_) != 0) {
          bitField0_ = other.bitField0_;
          value_ = other.value_;
          key.copyFrom(other.key);
        }
        return this;
      }

      @Override
      public DynamicValuesEntry mergeFrom(final DynamicValuesEntry other) {
        if (other.isEmpty()) {
          return this;
        }
        cachedSize = -1;
        if (other.hasValue()) {
          setValue(other.value_);
        }
        if (other.hasKey()) {
          getMutableKeyBytes().copyFrom(other.key);
        }
        return this;
      }

      @Override
      public DynamicValuesEntry clear() {
        if (isEmpty()) {
          return this;
        }
        cachedSize = -1;
        bitField0_ = 0;
        value_ = 0F;
        key.clear();
        return this;
      }

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

      @Override
      public boolean equals(Object o) {
        if (o == this) {
          return true;
        }
        if (!(o instanceof DynamicValuesEntry)) {
          return false;
        }
        DynamicValuesEntry other = (DynamicValuesEntry) o;
        return bitField0_ == other.bitField0_
          && (!hasValue() || ProtoUtil.isEqual(value_, other.value_))
          && (!hasKey() || key.equals(other.key));
      }

      @Override
      public void writeTo(final ProtoSink output) throws IOException {
        if ((bitField0_ & 0x00000001) != 0) {
          output.writeRawByte((byte) 21);
          output.writeFloatNoTag(value_);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeRawByte((byte) 10);
          output.writeStringNoTag(key);
        }
      }

      @Override
      protected int computeSerializedSize() {
        int size = 0;
        if ((bitField0_ & 0x00000001) != 0) {
          size += 5;
        }
        if ((bitField0_ & 0x00000002) != 0) {
          size += 1 + ProtoSink.computeStringSizeNoTag(key);
        }
        return size;
      }

      @Override
      @SuppressWarnings("fallthrough")
      public DynamicValuesEntry mergeFrom(final ProtoSource input) throws IOException {
        // Enabled Fall-Through Optimization (QuickBuffers)
        int tag = input.readTag();
        while (true) {
          switch (tag) {
            case 21: {
              // value_
              value_ = input.readFloat();
              bitField0_ |= 0x00000001;
              tag = input.readTag();
              if (tag != 10) {
                break;
              }
            }
            case 10: {
              // key
              input.readString(key);
              bitField0_ |= 0x00000002;
              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.writeFloat(FieldNames.value_, value_);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeString(FieldNames.key, key);
        }
        output.endObject();
      }

      @Override
      public DynamicValuesEntry mergeFrom(final JsonSource input) throws IOException {
        if (!input.beginObject()) {
          return this;
        }
        while (!input.isAtEnd()) {
          switch (input.readFieldHash()) {
            case 111972721: {
              if (input.isAtField(FieldNames.value_)) {
                if (!input.trySkipNullValue()) {
                  value_ = input.readFloat();
                  bitField0_ |= 0x00000001;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 106079: {
              if (input.isAtField(FieldNames.key)) {
                if (!input.trySkipNullValue()) {
                  input.readString(key);
                  bitField0_ |= 0x00000002;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            default: {
              input.skipUnknownField();
              break;
            }
          }
        }
        input.endObject();
        return this;
      }

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

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

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

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

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

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

      private enum DynamicValuesEntryFactory implements MessageFactory<DynamicValuesEntry> {
        INSTANCE;

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

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

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

    private enum BattleBuffFactory implements MessageFactory<BattleBuff> {
      INSTANCE;

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

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

      static final FieldName level = FieldName.forField("level");

      static final FieldName ownerId = FieldName.forField("ownerId", "owner_id");

      static final FieldName waveFlag = FieldName.forField("waveFlag", "wave_flag");

      static final FieldName targetIndexList = FieldName.forField("targetIndexList", "target_index_list");

      static final FieldName dynamicValues = FieldName.forField("dynamicValues", "dynamic_values");
    }
  }
}
