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

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

    /**
     * <code>optional int64 LastRefreshTime = 1;</code>
     */
    private long lastRefreshTime;

    /**
     * <code>optional uint32 UploadRemainTimes = 4;</code>
     */
    private int uploadRemainTimes;

    /**
     * <code>optional .TravelerDuelRankData Self = 2;</code>
     */
    private final TravelerDuelRankData self = TravelerDuelRankData.newInstance();

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

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</code>
     */
    private final RepeatedMessage<TravelerDuelRankData> rank = RepeatedMessage.newEmptyInstance(TravelerDuelRankData.getFactory());

    private TravelerDuelRankInfo() {
    }

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

    /**
     * <code>optional int64 LastRefreshTime = 1;</code>
     * @return whether the lastRefreshTime field is set
     */
    public boolean hasLastRefreshTime() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional int64 LastRefreshTime = 1;</code>
     * @return this
     */
    public TravelerDuelRankInfo clearLastRefreshTime() {
      bitField0_ &= ~0x00000001;
      lastRefreshTime = 0L;
      return this;
    }

    /**
     * <code>optional int64 LastRefreshTime = 1;</code>
     * @return the lastRefreshTime
     */
    public long getLastRefreshTime() {
      return lastRefreshTime;
    }

    /**
     * <code>optional int64 LastRefreshTime = 1;</code>
     * @param value the lastRefreshTime to set
     * @return this
     */
    public TravelerDuelRankInfo setLastRefreshTime(final long value) {
      bitField0_ |= 0x00000001;
      lastRefreshTime = value;
      return this;
    }

    /**
     * <code>optional uint32 UploadRemainTimes = 4;</code>
     * @return whether the uploadRemainTimes field is set
     */
    public boolean hasUploadRemainTimes() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 UploadRemainTimes = 4;</code>
     * @return this
     */
    public TravelerDuelRankInfo clearUploadRemainTimes() {
      bitField0_ &= ~0x00000002;
      uploadRemainTimes = 0;
      return this;
    }

    /**
     * <code>optional uint32 UploadRemainTimes = 4;</code>
     * @return the uploadRemainTimes
     */
    public int getUploadRemainTimes() {
      return uploadRemainTimes;
    }

    /**
     * <code>optional uint32 UploadRemainTimes = 4;</code>
     * @param value the uploadRemainTimes to set
     * @return this
     */
    public TravelerDuelRankInfo setUploadRemainTimes(final int value) {
      bitField0_ |= 0x00000002;
      uploadRemainTimes = value;
      return this;
    }

    /**
     * <code>optional .TravelerDuelRankData Self = 2;</code>
     * @return whether the self field is set
     */
    public boolean hasSelf() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional .TravelerDuelRankData Self = 2;</code>
     * @return this
     */
    public TravelerDuelRankInfo clearSelf() {
      bitField0_ &= ~0x00000004;
      self.clear();
      return this;
    }

    /**
     * <code>optional .TravelerDuelRankData Self = 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 #getMutableSelf()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public TravelerDuelRankData getSelf() {
      return self;
    }

    /**
     * <code>optional .TravelerDuelRankData Self = 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 TravelerDuelRankData getMutableSelf() {
      bitField0_ |= 0x00000004;
      return self;
    }

    /**
     * <code>optional .TravelerDuelRankData Self = 2;</code>
     * @param value the self to set
     * @return this
     */
    public TravelerDuelRankInfo setSelf(final TravelerDuelRankData value) {
      bitField0_ |= 0x00000004;
      self.copyFrom(value);
      return this;
    }

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

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

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

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

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

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</code>
     * @return whether the rank field is set
     */
    public boolean hasRank() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</code>
     * @return this
     */
    public TravelerDuelRankInfo clearRank() {
      bitField0_ &= ~0x00000010;
      rank.clear();
      return this;
    }

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</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 #getMutableRank()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<TravelerDuelRankData> getRank() {
      return rank;
    }

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</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<TravelerDuelRankData> getMutableRank() {
      bitField0_ |= 0x00000010;
      return rank;
    }

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</code>
     * @param value the rank to add
     * @return this
     */
    public TravelerDuelRankInfo addRank(final TravelerDuelRankData value) {
      bitField0_ |= 0x00000010;
      rank.add(value);
      return this;
    }

    /**
     * <code>repeated .TravelerDuelRankData Rank = 3;</code>
     * @param values the rank to add
     * @return this
     */
    public TravelerDuelRankInfo addAllRank(final TravelerDuelRankData... values) {
      bitField0_ |= 0x00000010;
      rank.addAll(values);
      return this;
    }

    @Override
    public TravelerDuelRankInfo copyFrom(final TravelerDuelRankInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        lastRefreshTime = other.lastRefreshTime;
        uploadRemainTimes = other.uploadRemainTimes;
        self.copyFrom(other.self);
        nextPackage.copyFrom(other.nextPackage);
        rank.copyFrom(other.rank);
      }
      return this;
    }

    @Override
    public TravelerDuelRankInfo mergeFrom(final TravelerDuelRankInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasLastRefreshTime()) {
        setLastRefreshTime(other.lastRefreshTime);
      }
      if (other.hasUploadRemainTimes()) {
        setUploadRemainTimes(other.uploadRemainTimes);
      }
      if (other.hasSelf()) {
        getMutableSelf().mergeFrom(other.self);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasRank()) {
        getMutableRank().addAll(other.rank);
      }
      return this;
    }

    @Override
    public TravelerDuelRankInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      lastRefreshTime = 0L;
      uploadRemainTimes = 0;
      self.clear();
      nextPackage.clear();
      rank.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof TravelerDuelRankInfo)) {
        return false;
      }
      TravelerDuelRankInfo other = (TravelerDuelRankInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasLastRefreshTime() || lastRefreshTime == other.lastRefreshTime)
        && (!hasUploadRemainTimes() || uploadRemainTimes == other.uploadRemainTimes)
        && (!hasSelf() || self.equals(other.self))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasRank() || rank.equals(other.rank));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeInt64NoTag(lastRefreshTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(uploadRemainTimes);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 18);
        output.writeMessageNoTag(self);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        for (int i = 0; i < rank.length(); i++) {
          output.writeRawByte((byte) 26);
          output.writeMessageNoTag(rank.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(lastRefreshTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(uploadRemainTimes);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(self);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += (1 * rank.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(rank);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public TravelerDuelRankInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // lastRefreshTime
            lastRefreshTime = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // uploadRemainTimes
            uploadRemainTimes = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // self
            input.readMessage(self);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // rank
            tag = input.readRepeatedMessage(rank, tag);
            bitField0_ |= 0x00000010;
            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.writeInt64(FieldNames.lastRefreshTime, lastRefreshTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.uploadRemainTimes, uploadRemainTimes);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeMessage(FieldNames.self, self);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRepeatedMessage(FieldNames.rank, rank);
      }
      output.endObject();
    }

    @Override
    public TravelerDuelRankInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -197072974: {
            if (input.isAtField(FieldNames.lastRefreshTime)) {
              if (!input.trySkipNullValue()) {
                lastRefreshTime = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1281247399: {
            if (input.isAtField(FieldNames.uploadRemainTimes)) {
              if (!input.trySkipNullValue()) {
                uploadRemainTimes = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2573164: {
            if (input.isAtField(FieldNames.self)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(self);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2539596: {
            if (input.isAtField(FieldNames.rank)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(rank);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum TravelerDuelRankInfoFactory implements MessageFactory<TravelerDuelRankInfo> {
      INSTANCE;

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

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

      static final FieldName uploadRemainTimes = FieldName.forField("UploadRemainTimes");

      static final FieldName self = FieldName.forField("Self");

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

      static final FieldName rank = FieldName.forField("Rank");
    }
  }

  /**
   * Protobuf type {@code TravelerDuelRankChar}
   */
  public static final class TravelerDuelRankChar extends ProtoMessage<TravelerDuelRankChar> 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 bytes NextPackage = 2047;</code>
     */
    private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();

    private TravelerDuelRankChar() {
    }

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

    /**
     * <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 TravelerDuelRankChar 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 TravelerDuelRankChar 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 TravelerDuelRankChar 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 TravelerDuelRankChar setLevel(final int value) {
      bitField0_ |= 0x00000002;
      level = 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 TravelerDuelRankChar 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 TravelerDuelRankChar 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 TravelerDuelRankChar 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 TravelerDuelRankChar setNextPackage(final byte... values) {
      bitField0_ |= 0x00000004;
      nextPackage.copyFrom(values);
      return this;
    }

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

    @Override
    public TravelerDuelRankChar mergeFrom(final TravelerDuelRankChar other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasLevel()) {
        setLevel(other.level);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      return this;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof TravelerDuelRankChar)) {
        return false;
      }
      TravelerDuelRankChar other = (TravelerDuelRankChar) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasLevel() || level == other.level)
        && (!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(level);
      }
      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.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(level);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public TravelerDuelRankChar 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 != 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.writeUInt32(FieldNames.id, id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.level, level);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      output.endObject();
    }

    @Override
    public TravelerDuelRankChar 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 73313124: {
            if (input.isAtField(FieldNames.level)) {
              if (!input.trySkipNullValue()) {
                level = input.readUInt32();
                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 TravelerDuelRankChar clone() {
      return new TravelerDuelRankChar().copyFrom(this);
    }

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

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

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

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

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

    private enum TravelerDuelRankCharFactory implements MessageFactory<TravelerDuelRankChar> {
      INSTANCE;

      @Override
      public TravelerDuelRankChar create() {
        return TravelerDuelRankChar.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 nextPackage = FieldName.forField("NextPackage");
    }
  }

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

    /**
     * <code>optional uint64 Id = 1;</code>
     */
    private long id;

    /**
     * <code>optional uint32 WorldClass = 3;</code>
     */
    private int worldClass;

    /**
     * <code>optional uint32 HeadIcon = 4;</code>
     */
    private int headIcon;

    /**
     * <code>optional uint32 Score = 5;</code>
     */
    private int score;

    /**
     * <code>optional uint32 Rank = 6;</code>
     */
    private int rank;

    /**
     * <code>optional uint32 BuildScore = 7;</code>
     */
    private int buildScore;

    /**
     * <code>optional uint32 TitlePrefix = 8;</code>
     */
    private int titlePrefix;

    /**
     * <code>optional uint32 TitleSuffix = 9;</code>
     */
    private int titleSuffix;

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

    /**
     * <code>optional string NickName = 2;</code>
     */
    private final Utf8String nickName = Utf8String.newEmptyInstance();

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</code>
     */
    private final RepeatedMessage<TravelerDuelRankChar> chars = RepeatedMessage.newEmptyInstance(TravelerDuelRankChar.getFactory());

    /**
     * <code>repeated .HonorInfo Honors = 15;</code>
     */
    private final RepeatedMessage<Public.HonorInfo> honors = RepeatedMessage.newEmptyInstance(Public.HonorInfo.getFactory());

    private TravelerDuelRankData() {
    }

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

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

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

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

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

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

    /**
     * <code>optional uint32 WorldClass = 3;</code>
     * @return this
     */
    public TravelerDuelRankData clearWorldClass() {
      bitField0_ &= ~0x00000002;
      worldClass = 0;
      return this;
    }

    /**
     * <code>optional uint32 WorldClass = 3;</code>
     * @return the worldClass
     */
    public int getWorldClass() {
      return worldClass;
    }

    /**
     * <code>optional uint32 WorldClass = 3;</code>
     * @param value the worldClass to set
     * @return this
     */
    public TravelerDuelRankData setWorldClass(final int value) {
      bitField0_ |= 0x00000002;
      worldClass = value;
      return this;
    }

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

    /**
     * <code>optional uint32 HeadIcon = 4;</code>
     * @return this
     */
    public TravelerDuelRankData clearHeadIcon() {
      bitField0_ &= ~0x00000004;
      headIcon = 0;
      return this;
    }

    /**
     * <code>optional uint32 HeadIcon = 4;</code>
     * @return the headIcon
     */
    public int getHeadIcon() {
      return headIcon;
    }

    /**
     * <code>optional uint32 HeadIcon = 4;</code>
     * @param value the headIcon to set
     * @return this
     */
    public TravelerDuelRankData setHeadIcon(final int value) {
      bitField0_ |= 0x00000004;
      headIcon = value;
      return this;
    }

    /**
     * <code>optional uint32 Score = 5;</code>
     * @return whether the score field is set
     */
    public boolean hasScore() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional uint32 Score = 5;</code>
     * @return this
     */
    public TravelerDuelRankData clearScore() {
      bitField0_ &= ~0x00000008;
      score = 0;
      return this;
    }

    /**
     * <code>optional uint32 Score = 5;</code>
     * @return the score
     */
    public int getScore() {
      return score;
    }

    /**
     * <code>optional uint32 Score = 5;</code>
     * @param value the score to set
     * @return this
     */
    public TravelerDuelRankData setScore(final int value) {
      bitField0_ |= 0x00000008;
      score = value;
      return this;
    }

    /**
     * <code>optional uint32 Rank = 6;</code>
     * @return whether the rank field is set
     */
    public boolean hasRank() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional uint32 Rank = 6;</code>
     * @return this
     */
    public TravelerDuelRankData clearRank() {
      bitField0_ &= ~0x00000010;
      rank = 0;
      return this;
    }

    /**
     * <code>optional uint32 Rank = 6;</code>
     * @return the rank
     */
    public int getRank() {
      return rank;
    }

    /**
     * <code>optional uint32 Rank = 6;</code>
     * @param value the rank to set
     * @return this
     */
    public TravelerDuelRankData setRank(final int value) {
      bitField0_ |= 0x00000010;
      rank = value;
      return this;
    }

    /**
     * <code>optional uint32 BuildScore = 7;</code>
     * @return whether the buildScore field is set
     */
    public boolean hasBuildScore() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional uint32 BuildScore = 7;</code>
     * @return this
     */
    public TravelerDuelRankData clearBuildScore() {
      bitField0_ &= ~0x00000020;
      buildScore = 0;
      return this;
    }

    /**
     * <code>optional uint32 BuildScore = 7;</code>
     * @return the buildScore
     */
    public int getBuildScore() {
      return buildScore;
    }

    /**
     * <code>optional uint32 BuildScore = 7;</code>
     * @param value the buildScore to set
     * @return this
     */
    public TravelerDuelRankData setBuildScore(final int value) {
      bitField0_ |= 0x00000020;
      buildScore = value;
      return this;
    }

    /**
     * <code>optional uint32 TitlePrefix = 8;</code>
     * @return whether the titlePrefix field is set
     */
    public boolean hasTitlePrefix() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional uint32 TitlePrefix = 8;</code>
     * @return this
     */
    public TravelerDuelRankData clearTitlePrefix() {
      bitField0_ &= ~0x00000040;
      titlePrefix = 0;
      return this;
    }

    /**
     * <code>optional uint32 TitlePrefix = 8;</code>
     * @return the titlePrefix
     */
    public int getTitlePrefix() {
      return titlePrefix;
    }

    /**
     * <code>optional uint32 TitlePrefix = 8;</code>
     * @param value the titlePrefix to set
     * @return this
     */
    public TravelerDuelRankData setTitlePrefix(final int value) {
      bitField0_ |= 0x00000040;
      titlePrefix = value;
      return this;
    }

    /**
     * <code>optional uint32 TitleSuffix = 9;</code>
     * @return whether the titleSuffix field is set
     */
    public boolean hasTitleSuffix() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional uint32 TitleSuffix = 9;</code>
     * @return this
     */
    public TravelerDuelRankData clearTitleSuffix() {
      bitField0_ &= ~0x00000080;
      titleSuffix = 0;
      return this;
    }

    /**
     * <code>optional uint32 TitleSuffix = 9;</code>
     * @return the titleSuffix
     */
    public int getTitleSuffix() {
      return titleSuffix;
    }

    /**
     * <code>optional uint32 TitleSuffix = 9;</code>
     * @param value the titleSuffix to set
     * @return this
     */
    public TravelerDuelRankData setTitleSuffix(final int value) {
      bitField0_ |= 0x00000080;
      titleSuffix = value;
      return this;
    }

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

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

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

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

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

    /**
     * <code>optional string NickName = 2;</code>
     * @return whether the nickName field is set
     */
    public boolean hasNickName() {
      return (bitField0_ & 0x00000200) != 0;
    }

    /**
     * <code>optional string NickName = 2;</code>
     * @return this
     */
    public TravelerDuelRankData clearNickName() {
      bitField0_ &= ~0x00000200;
      nickName.clear();
      return this;
    }

    /**
     * <code>optional string NickName = 2;</code>
     * @return the nickName
     */
    public String getNickName() {
      return nickName.getString();
    }

    /**
     * <code>optional string NickName = 2;</code>
     * @return internal {@code Utf8String} representation of nickName for reading
     */
    public Utf8String getNickNameBytes() {
      return this.nickName;
    }

    /**
     * <code>optional string NickName = 2;</code>
     * @return internal {@code Utf8String} representation of nickName for modifications
     */
    public Utf8String getMutableNickNameBytes() {
      bitField0_ |= 0x00000200;
      return this.nickName;
    }

    /**
     * <code>optional string NickName = 2;</code>
     * @param value the nickName to set
     * @return this
     */
    public TravelerDuelRankData setNickName(final CharSequence value) {
      bitField0_ |= 0x00000200;
      nickName.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string NickName = 2;</code>
     * @param value the nickName to set
     * @return this
     */
    public TravelerDuelRankData setNickName(final Utf8String value) {
      bitField0_ |= 0x00000200;
      nickName.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</code>
     * @return whether the chars field is set
     */
    public boolean hasChars() {
      return (bitField0_ & 0x00000400) != 0;
    }

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</code>
     * @return this
     */
    public TravelerDuelRankData clearChars() {
      bitField0_ &= ~0x00000400;
      chars.clear();
      return this;
    }

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</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 #getMutableChars()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<TravelerDuelRankChar> getChars() {
      return chars;
    }

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</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<TravelerDuelRankChar> getMutableChars() {
      bitField0_ |= 0x00000400;
      return chars;
    }

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</code>
     * @param value the chars to add
     * @return this
     */
    public TravelerDuelRankData addChars(final TravelerDuelRankChar value) {
      bitField0_ |= 0x00000400;
      chars.add(value);
      return this;
    }

    /**
     * <code>repeated .TravelerDuelRankChar Chars = 10;</code>
     * @param values the chars to add
     * @return this
     */
    public TravelerDuelRankData addAllChars(final TravelerDuelRankChar... values) {
      bitField0_ |= 0x00000400;
      chars.addAll(values);
      return this;
    }

    /**
     * <code>repeated .HonorInfo Honors = 15;</code>
     * @return whether the honors field is set
     */
    public boolean hasHonors() {
      return (bitField0_ & 0x00000800) != 0;
    }

    /**
     * <code>repeated .HonorInfo Honors = 15;</code>
     * @return this
     */
    public TravelerDuelRankData clearHonors() {
      bitField0_ &= ~0x00000800;
      honors.clear();
      return this;
    }

    /**
     * <code>repeated .HonorInfo Honors = 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 #getMutableHonors()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<Public.HonorInfo> getHonors() {
      return honors;
    }

    /**
     * <code>repeated .HonorInfo Honors = 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 RepeatedMessage<Public.HonorInfo> getMutableHonors() {
      bitField0_ |= 0x00000800;
      return honors;
    }

    /**
     * <code>repeated .HonorInfo Honors = 15;</code>
     * @param value the honors to add
     * @return this
     */
    public TravelerDuelRankData addHonors(final Public.HonorInfo value) {
      bitField0_ |= 0x00000800;
      honors.add(value);
      return this;
    }

    /**
     * <code>repeated .HonorInfo Honors = 15;</code>
     * @param values the honors to add
     * @return this
     */
    public TravelerDuelRankData addAllHonors(final Public.HonorInfo... values) {
      bitField0_ |= 0x00000800;
      honors.addAll(values);
      return this;
    }

    @Override
    public TravelerDuelRankData copyFrom(final TravelerDuelRankData other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        worldClass = other.worldClass;
        headIcon = other.headIcon;
        score = other.score;
        rank = other.rank;
        buildScore = other.buildScore;
        titlePrefix = other.titlePrefix;
        titleSuffix = other.titleSuffix;
        nextPackage.copyFrom(other.nextPackage);
        nickName.copyFrom(other.nickName);
        chars.copyFrom(other.chars);
        honors.copyFrom(other.honors);
      }
      return this;
    }

    @Override
    public TravelerDuelRankData mergeFrom(final TravelerDuelRankData other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasWorldClass()) {
        setWorldClass(other.worldClass);
      }
      if (other.hasHeadIcon()) {
        setHeadIcon(other.headIcon);
      }
      if (other.hasScore()) {
        setScore(other.score);
      }
      if (other.hasRank()) {
        setRank(other.rank);
      }
      if (other.hasBuildScore()) {
        setBuildScore(other.buildScore);
      }
      if (other.hasTitlePrefix()) {
        setTitlePrefix(other.titlePrefix);
      }
      if (other.hasTitleSuffix()) {
        setTitleSuffix(other.titleSuffix);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasNickName()) {
        getMutableNickNameBytes().copyFrom(other.nickName);
      }
      if (other.hasChars()) {
        getMutableChars().addAll(other.chars);
      }
      if (other.hasHonors()) {
        getMutableHonors().addAll(other.honors);
      }
      return this;
    }

    @Override
    public TravelerDuelRankData clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0L;
      worldClass = 0;
      headIcon = 0;
      score = 0;
      rank = 0;
      buildScore = 0;
      titlePrefix = 0;
      titleSuffix = 0;
      nextPackage.clear();
      nickName.clear();
      chars.clear();
      honors.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof TravelerDuelRankData)) {
        return false;
      }
      TravelerDuelRankData other = (TravelerDuelRankData) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasWorldClass() || worldClass == other.worldClass)
        && (!hasHeadIcon() || headIcon == other.headIcon)
        && (!hasScore() || score == other.score)
        && (!hasRank() || rank == other.rank)
        && (!hasBuildScore() || buildScore == other.buildScore)
        && (!hasTitlePrefix() || titlePrefix == other.titlePrefix)
        && (!hasTitleSuffix() || titleSuffix == other.titleSuffix)
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasNickName() || nickName.equals(other.nickName))
        && (!hasChars() || chars.equals(other.chars))
        && (!hasHonors() || honors.equals(other.honors));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt64NoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 24);
        output.writeUInt32NoTag(worldClass);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(headIcon);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 40);
        output.writeUInt32NoTag(score);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 48);
        output.writeUInt32NoTag(rank);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 56);
        output.writeUInt32NoTag(buildScore);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 64);
        output.writeUInt32NoTag(titlePrefix);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 72);
        output.writeUInt32NoTag(titleSuffix);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRawByte((byte) 18);
        output.writeStringNoTag(nickName);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        for (int i = 0; i < chars.length(); i++) {
          output.writeRawByte((byte) 82);
          output.writeMessageNoTag(chars.get(i));
        }
      }
      if ((bitField0_ & 0x00000800) != 0) {
        for (int i = 0; i < honors.length(); i++) {
          output.writeRawByte((byte) 122);
          output.writeMessageNoTag(honors.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt64SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(worldClass);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(headIcon);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(score);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(rank);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(buildScore);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(titlePrefix);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(titleSuffix);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(nickName);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        size += (1 * chars.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(chars);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        size += (1 * honors.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(honors);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public TravelerDuelRankData mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // id
            id = input.readUInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // worldClass
            worldClass = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // headIcon
            headIcon = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 40) {
              break;
            }
          }
          case 40: {
            // score
            score = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 48) {
              break;
            }
          }
          case 48: {
            // rank
            rank = input.readUInt32();
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 56) {
              break;
            }
          }
          case 56: {
            // buildScore
            buildScore = input.readUInt32();
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 64) {
              break;
            }
          }
          case 64: {
            // titlePrefix
            titlePrefix = input.readUInt32();
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 72) {
              break;
            }
          }
          case 72: {
            // titleSuffix
            titleSuffix = input.readUInt32();
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // nickName
            input.readString(nickName);
            bitField0_ |= 0x00000200;
            tag = input.readTag();
            if (tag != 82) {
              break;
            }
          }
          case 82: {
            // chars
            tag = input.readRepeatedMessage(chars, tag);
            bitField0_ |= 0x00000400;
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // honors
            tag = input.readRepeatedMessage(honors, tag);
            bitField0_ |= 0x00000800;
            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.writeUInt64(FieldNames.id, id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.worldClass, worldClass);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.headIcon, headIcon);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.score, score);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeUInt32(FieldNames.rank, rank);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeUInt32(FieldNames.buildScore, buildScore);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeUInt32(FieldNames.titlePrefix, titlePrefix);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeUInt32(FieldNames.titleSuffix, titleSuffix);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeString(FieldNames.nickName, nickName);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeRepeatedMessage(FieldNames.chars, chars);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeRepeatedMessage(FieldNames.honors, honors);
      }
      output.endObject();
    }

    @Override
    public TravelerDuelRankData 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.readUInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1869617882: {
            if (input.isAtField(FieldNames.worldClass)) {
              if (!input.trySkipNullValue()) {
                worldClass = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1051463015: {
            if (input.isAtField(FieldNames.headIcon)) {
              if (!input.trySkipNullValue()) {
                headIcon = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 79711858: {
            if (input.isAtField(FieldNames.score)) {
              if (!input.trySkipNullValue()) {
                score = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2539596: {
            if (input.isAtField(FieldNames.rank)) {
              if (!input.trySkipNullValue()) {
                rank = input.readUInt32();
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1511471332: {
            if (input.isAtField(FieldNames.buildScore)) {
              if (!input.trySkipNullValue()) {
                buildScore = input.readUInt32();
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2096776938: {
            if (input.isAtField(FieldNames.titlePrefix)) {
              if (!input.trySkipNullValue()) {
                titlePrefix = input.readUInt32();
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2109502551: {
            if (input.isAtField(FieldNames.titleSuffix)) {
              if (!input.trySkipNullValue()) {
                titleSuffix = input.readUInt32();
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 134381742: {
            if (input.isAtField(FieldNames.nickName)) {
              if (!input.trySkipNullValue()) {
                input.readString(nickName);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 65071037: {
            if (input.isAtField(FieldNames.chars)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(chars);
                bitField0_ |= 0x00000400;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2127770263: {
            if (input.isAtField(FieldNames.honors)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(honors);
                bitField0_ |= 0x00000800;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum TravelerDuelRankDataFactory implements MessageFactory<TravelerDuelRankData> {
      INSTANCE;

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

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

      static final FieldName worldClass = FieldName.forField("WorldClass");

      static final FieldName headIcon = FieldName.forField("HeadIcon");

      static final FieldName score = FieldName.forField("Score");

      static final FieldName rank = FieldName.forField("Rank");

      static final FieldName buildScore = FieldName.forField("BuildScore");

      static final FieldName titlePrefix = FieldName.forField("TitlePrefix");

      static final FieldName titleSuffix = FieldName.forField("TitleSuffix");

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

      static final FieldName nickName = FieldName.forField("NickName");

      static final FieldName chars = FieldName.forField("Chars");

      static final FieldName honors = FieldName.forField("Honors");
    }
  }
}
