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

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

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

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

    /**
     * <code>optional .Events Events = 15;</code>
     */
    private final Public.Events events = Public.Events.newInstance();

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

    private DailyInstanceRaidReq() {
    }

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

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

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

    /**
     * <code>optional uint32 RewardType = 2;</code>
     * @return this
     */
    public DailyInstanceRaidReq clearRewardType() {
      bitField0_ &= ~0x00000002;
      rewardType = 0;
      return this;
    }

    /**
     * <code>optional uint32 RewardType = 2;</code>
     * @return the rewardType
     */
    public int getRewardType() {
      return rewardType;
    }

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

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

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

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

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

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

    /**
     * <code>optional .Events Events = 15;</code>
     * @return this
     */
    public DailyInstanceRaidReq clearEvents() {
      bitField0_ &= ~0x00000008;
      events.clear();
      return this;
    }

    /**
     * <code>optional .Events Events = 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 #getMutableEvents()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public Public.Events getEvents() {
      return events;
    }

    /**
     * <code>optional .Events Events = 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 Public.Events getMutableEvents() {
      bitField0_ |= 0x00000008;
      return events;
    }

    /**
     * <code>optional .Events Events = 15;</code>
     * @param value the events to set
     * @return this
     */
    public DailyInstanceRaidReq setEvents(final Public.Events value) {
      bitField0_ |= 0x00000008;
      events.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 DailyInstanceRaidReq 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 DailyInstanceRaidReq 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 DailyInstanceRaidReq 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 DailyInstanceRaidReq setNextPackage(final byte... values) {
      bitField0_ |= 0x00000010;
      nextPackage.copyFrom(values);
      return this;
    }

    @Override
    public DailyInstanceRaidReq copyFrom(final DailyInstanceRaidReq other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        rewardType = other.rewardType;
        times = other.times;
        events.copyFrom(other.events);
        nextPackage.copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public DailyInstanceRaidReq mergeFrom(final DailyInstanceRaidReq other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasRewardType()) {
        setRewardType(other.rewardType);
      }
      if (other.hasTimes()) {
        setTimes(other.times);
      }
      if (other.hasEvents()) {
        getMutableEvents().mergeFrom(other.events);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public DailyInstanceRaidReq clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0;
      rewardType = 0;
      times = 0;
      events.clear();
      nextPackage.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof DailyInstanceRaidReq)) {
        return false;
      }
      DailyInstanceRaidReq other = (DailyInstanceRaidReq) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasRewardType() || rewardType == other.rewardType)
        && (!hasTimes() || times == other.times)
        && (!hasEvents() || events.equals(other.events))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(rewardType);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(times);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 122);
        output.writeMessageNoTag(events);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
    }

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

    @Override
    @SuppressWarnings("fallthrough")
    public DailyInstanceRaidReq 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: {
            // rewardType
            rewardType = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // times
            times = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // events
            input.readMessage(events);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.id, id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.rewardType, rewardType);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.times, times);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeMessage(FieldNames.events, events);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      output.endObject();
    }

    @Override
    public DailyInstanceRaidReq 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 -610271447: {
            if (input.isAtField(FieldNames.rewardType)) {
              if (!input.trySkipNullValue()) {
                rewardType = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 80811814: {
            if (input.isAtField(FieldNames.times)) {
              if (!input.trySkipNullValue()) {
                times = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2087505209: {
            if (input.isAtField(FieldNames.events)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(events);
                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;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum DailyInstanceRaidReqFactory implements MessageFactory<DailyInstanceRaidReq> {
      INSTANCE;

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

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

      static final FieldName rewardType = FieldName.forField("RewardType");

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

      static final FieldName events = FieldName.forField("Events");

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

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

    /**
     * <code>optional uint32 Exp = 15;</code>
     */
    private int exp;

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

    /**
     * <code>repeated .Item Select = 1;</code>
     */
    private final RepeatedMessage<Public.Item> select = RepeatedMessage.newEmptyInstance(Public.Item.getFactory());

    private DailyInstanceReward() {
    }

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

    /**
     * <code>optional uint32 Exp = 15;</code>
     * @return whether the exp field is set
     */
    public boolean hasExp() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 Exp = 15;</code>
     * @return this
     */
    public DailyInstanceReward clearExp() {
      bitField0_ &= ~0x00000001;
      exp = 0;
      return this;
    }

    /**
     * <code>optional uint32 Exp = 15;</code>
     * @return the exp
     */
    public int getExp() {
      return exp;
    }

    /**
     * <code>optional uint32 Exp = 15;</code>
     * @param value the exp to set
     * @return this
     */
    public DailyInstanceReward setExp(final int value) {
      bitField0_ |= 0x00000001;
      exp = value;
      return this;
    }

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

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

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

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

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

    /**
     * <code>repeated .Item Select = 1;</code>
     * @return whether the select field is set
     */
    public boolean hasSelect() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated .Item Select = 1;</code>
     * @return this
     */
    public DailyInstanceReward clearSelect() {
      bitField0_ &= ~0x00000004;
      select.clear();
      return this;
    }

    /**
     * <code>repeated .Item Select = 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 #getMutableSelect()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<Public.Item> getSelect() {
      return select;
    }

    /**
     * <code>repeated .Item Select = 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<Public.Item> getMutableSelect() {
      bitField0_ |= 0x00000004;
      return select;
    }

    /**
     * <code>repeated .Item Select = 1;</code>
     * @param value the select to add
     * @return this
     */
    public DailyInstanceReward addSelect(final Public.Item value) {
      bitField0_ |= 0x00000004;
      select.add(value);
      return this;
    }

    /**
     * <code>repeated .Item Select = 1;</code>
     * @param values the select to add
     * @return this
     */
    public DailyInstanceReward addAllSelect(final Public.Item... values) {
      bitField0_ |= 0x00000004;
      select.addAll(values);
      return this;
    }

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

    @Override
    public DailyInstanceReward mergeFrom(final DailyInstanceReward other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasExp()) {
        setExp(other.exp);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasSelect()) {
        getMutableSelect().addAll(other.select);
      }
      return this;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof DailyInstanceReward)) {
        return false;
      }
      DailyInstanceReward other = (DailyInstanceReward) o;
      return bitField0_ == other.bitField0_
        && (!hasExp() || exp == other.exp)
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasSelect() || select.equals(other.select));
    }

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

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

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

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

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

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

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

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

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

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

    private enum DailyInstanceRewardFactory implements MessageFactory<DailyInstanceReward> {
      INSTANCE;

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

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

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

      static final FieldName select = FieldName.forField("Select");
    }
  }

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

    /**
     * <code>optional .ChangeInfo Change = 2;</code>
     */
    private final Public.ChangeInfo change = Public.ChangeInfo.newInstance();

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

    /**
     * <code>repeated .DailyInstanceReward Rewards = 1;</code>
     */
    private final RepeatedMessage<DailyInstanceReward> rewards = RepeatedMessage.newEmptyInstance(DailyInstanceReward.getFactory());

    private DailyInstanceRaidResp() {
    }

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

    /**
     * <code>optional .ChangeInfo Change = 2;</code>
     * @return whether the change field is set
     */
    public boolean hasChange() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional .ChangeInfo Change = 2;</code>
     * @return this
     */
    public DailyInstanceRaidResp clearChange() {
      bitField0_ &= ~0x00000001;
      change.clear();
      return this;
    }

    /**
     * <code>optional .ChangeInfo Change = 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 #getMutableChange()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public Public.ChangeInfo getChange() {
      return change;
    }

    /**
     * <code>optional .ChangeInfo Change = 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 Public.ChangeInfo getMutableChange() {
      bitField0_ |= 0x00000001;
      return change;
    }

    /**
     * <code>optional .ChangeInfo Change = 2;</code>
     * @param value the change to set
     * @return this
     */
    public DailyInstanceRaidResp setChange(final Public.ChangeInfo value) {
      bitField0_ |= 0x00000001;
      change.copyFrom(value);
      return this;
    }

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

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

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

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

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

    /**
     * <code>repeated .DailyInstanceReward Rewards = 1;</code>
     * @return whether the rewards field is set
     */
    public boolean hasRewards() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated .DailyInstanceReward Rewards = 1;</code>
     * @return this
     */
    public DailyInstanceRaidResp clearRewards() {
      bitField0_ &= ~0x00000004;
      rewards.clear();
      return this;
    }

    /**
     * <code>repeated .DailyInstanceReward Rewards = 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 #getMutableRewards()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<DailyInstanceReward> getRewards() {
      return rewards;
    }

    /**
     * <code>repeated .DailyInstanceReward Rewards = 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<DailyInstanceReward> getMutableRewards() {
      bitField0_ |= 0x00000004;
      return rewards;
    }

    /**
     * <code>repeated .DailyInstanceReward Rewards = 1;</code>
     * @param value the rewards to add
     * @return this
     */
    public DailyInstanceRaidResp addRewards(final DailyInstanceReward value) {
      bitField0_ |= 0x00000004;
      rewards.add(value);
      return this;
    }

    /**
     * <code>repeated .DailyInstanceReward Rewards = 1;</code>
     * @param values the rewards to add
     * @return this
     */
    public DailyInstanceRaidResp addAllRewards(final DailyInstanceReward... values) {
      bitField0_ |= 0x00000004;
      rewards.addAll(values);
      return this;
    }

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

    @Override
    public DailyInstanceRaidResp mergeFrom(final DailyInstanceRaidResp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasChange()) {
        getMutableChange().mergeFrom(other.change);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasRewards()) {
        getMutableRewards().addAll(other.rewards);
      }
      return this;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof DailyInstanceRaidResp)) {
        return false;
      }
      DailyInstanceRaidResp other = (DailyInstanceRaidResp) o;
      return bitField0_ == other.bitField0_
        && (!hasChange() || change.equals(other.change))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasRewards() || rewards.equals(other.rewards));
    }

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

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

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

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

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

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

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

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

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

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

    private enum DailyInstanceRaidRespFactory implements MessageFactory<DailyInstanceRaidResp> {
      INSTANCE;

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

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

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

      static final FieldName rewards = FieldName.forField("Rewards");
    }
  }
}
