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

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

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

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

    /**
     * <code>optional int64 expire_time = 7;</code>
     */
    private long expireTime;

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

    /**
     * <code>optional uint32 template_id = 10;</code>
     */
    private int templateId;

    /**
     * <code>optional bool is_read = 3;</code>
     */
    private boolean isRead;

    /**
     * <code>optional .ItemList attachment = 15;</code>
     */
    private final ItemListOuterClass.ItemList attachment = ItemListOuterClass.ItemList.newInstance();

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

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

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

    /**
     * <code>repeated string para_list = 6;</code>
     */
    private final RepeatedString paraList = RepeatedString.newEmptyInstance();

    private ClientMail() {
    }

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

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

    /**
     * <code>optional int64 time = 1;</code>
     * @return this
     */
    public ClientMail clearTime() {
      bitField0_ &= ~0x00000001;
      time = 0L;
      return this;
    }

    /**
     * <code>optional int64 time = 1;</code>
     * @return the time
     */
    public long getTime() {
      return time;
    }

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

    /**
     * <code>optional int64 expire_time = 7;</code>
     * @return whether the expireTime field is set
     */
    public boolean hasExpireTime() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional int64 expire_time = 7;</code>
     * @return this
     */
    public ClientMail clearExpireTime() {
      bitField0_ &= ~0x00000002;
      expireTime = 0L;
      return this;
    }

    /**
     * <code>optional int64 expire_time = 7;</code>
     * @return the expireTime
     */
    public long getExpireTime() {
      return expireTime;
    }

    /**
     * <code>optional int64 expire_time = 7;</code>
     * @param value the expireTime to set
     * @return this
     */
    public ClientMail setExpireTime(final long value) {
      bitField0_ |= 0x00000002;
      expireTime = value;
      return this;
    }

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

    /**
     * <code>optional uint32 id = 2;</code>
     * @return this
     */
    public ClientMail clearId() {
      bitField0_ &= ~0x00000004;
      id = 0;
      return this;
    }

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

    /**
     * <code>optional uint32 id = 2;</code>
     * @param value the id to set
     * @return this
     */
    public ClientMail setId(final int value) {
      bitField0_ |= 0x00000004;
      id = value;
      return this;
    }

    /**
     * <code>optional uint32 template_id = 10;</code>
     * @return whether the templateId field is set
     */
    public boolean hasTemplateId() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional uint32 template_id = 10;</code>
     * @return this
     */
    public ClientMail clearTemplateId() {
      bitField0_ &= ~0x00000008;
      templateId = 0;
      return this;
    }

    /**
     * <code>optional uint32 template_id = 10;</code>
     * @return the templateId
     */
    public int getTemplateId() {
      return templateId;
    }

    /**
     * <code>optional uint32 template_id = 10;</code>
     * @param value the templateId to set
     * @return this
     */
    public ClientMail setTemplateId(final int value) {
      bitField0_ |= 0x00000008;
      templateId = value;
      return this;
    }

    /**
     * <code>optional bool is_read = 3;</code>
     * @return whether the isRead field is set
     */
    public boolean hasIsRead() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional bool is_read = 3;</code>
     * @return this
     */
    public ClientMail clearIsRead() {
      bitField0_ &= ~0x00000010;
      isRead = false;
      return this;
    }

    /**
     * <code>optional bool is_read = 3;</code>
     * @return the isRead
     */
    public boolean getIsRead() {
      return isRead;
    }

    /**
     * <code>optional bool is_read = 3;</code>
     * @param value the isRead to set
     * @return this
     */
    public ClientMail setIsRead(final boolean value) {
      bitField0_ |= 0x00000010;
      isRead = value;
      return this;
    }

    /**
     * <code>optional .ItemList attachment = 15;</code>
     * @return whether the attachment field is set
     */
    public boolean hasAttachment() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional .ItemList attachment = 15;</code>
     * @return this
     */
    public ClientMail clearAttachment() {
      bitField0_ &= ~0x00000020;
      attachment.clear();
      return this;
    }

    /**
     * <code>optional .ItemList attachment = 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 #getMutableAttachment()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public ItemListOuterClass.ItemList getAttachment() {
      return attachment;
    }

    /**
     * <code>optional .ItemList attachment = 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 ItemListOuterClass.ItemList getMutableAttachment() {
      bitField0_ |= 0x00000020;
      return attachment;
    }

    /**
     * <code>optional .ItemList attachment = 15;</code>
     * @param value the attachment to set
     * @return this
     */
    public ClientMail setAttachment(final ItemListOuterClass.ItemList value) {
      bitField0_ |= 0x00000020;
      attachment.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string content = 4;</code>
     * @return whether the content field is set
     */
    public boolean hasContent() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional string content = 4;</code>
     * @return this
     */
    public ClientMail clearContent() {
      bitField0_ &= ~0x00000040;
      content.clear();
      return this;
    }

    /**
     * <code>optional string content = 4;</code>
     * @return the content
     */
    public String getContent() {
      return content.getString();
    }

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

    /**
     * <code>optional string content = 4;</code>
     * @return internal {@code Utf8String} representation of content for modifications
     */
    public Utf8String getMutableContentBytes() {
      bitField0_ |= 0x00000040;
      return this.content;
    }

    /**
     * <code>optional string content = 4;</code>
     * @param value the content to set
     * @return this
     */
    public ClientMail setContent(final CharSequence value) {
      bitField0_ |= 0x00000040;
      content.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string content = 4;</code>
     * @param value the content to set
     * @return this
     */
    public ClientMail setContent(final Utf8String value) {
      bitField0_ |= 0x00000040;
      content.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string sender = 11;</code>
     * @return whether the sender field is set
     */
    public boolean hasSender() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional string sender = 11;</code>
     * @return this
     */
    public ClientMail clearSender() {
      bitField0_ &= ~0x00000080;
      sender.clear();
      return this;
    }

    /**
     * <code>optional string sender = 11;</code>
     * @return the sender
     */
    public String getSender() {
      return sender.getString();
    }

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

    /**
     * <code>optional string sender = 11;</code>
     * @return internal {@code Utf8String} representation of sender for modifications
     */
    public Utf8String getMutableSenderBytes() {
      bitField0_ |= 0x00000080;
      return this.sender;
    }

    /**
     * <code>optional string sender = 11;</code>
     * @param value the sender to set
     * @return this
     */
    public ClientMail setSender(final CharSequence value) {
      bitField0_ |= 0x00000080;
      sender.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string sender = 11;</code>
     * @param value the sender to set
     * @return this
     */
    public ClientMail setSender(final Utf8String value) {
      bitField0_ |= 0x00000080;
      sender.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string title = 12;</code>
     * @return whether the title field is set
     */
    public boolean hasTitle() {
      return (bitField0_ & 0x00000100) != 0;
    }

    /**
     * <code>optional string title = 12;</code>
     * @return this
     */
    public ClientMail clearTitle() {
      bitField0_ &= ~0x00000100;
      title.clear();
      return this;
    }

    /**
     * <code>optional string title = 12;</code>
     * @return the title
     */
    public String getTitle() {
      return title.getString();
    }

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

    /**
     * <code>optional string title = 12;</code>
     * @return internal {@code Utf8String} representation of title for modifications
     */
    public Utf8String getMutableTitleBytes() {
      bitField0_ |= 0x00000100;
      return this.title;
    }

    /**
     * <code>optional string title = 12;</code>
     * @param value the title to set
     * @return this
     */
    public ClientMail setTitle(final CharSequence value) {
      bitField0_ |= 0x00000100;
      title.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string title = 12;</code>
     * @param value the title to set
     * @return this
     */
    public ClientMail setTitle(final Utf8String value) {
      bitField0_ |= 0x00000100;
      title.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated string para_list = 6;</code>
     * @return whether the paraList field is set
     */
    public boolean hasParaList() {
      return (bitField0_ & 0x00000200) != 0;
    }

    /**
     * <code>repeated string para_list = 6;</code>
     * @return this
     */
    public ClientMail clearParaList() {
      bitField0_ &= ~0x00000200;
      paraList.clear();
      return this;
    }

    /**
     * <code>repeated string para_list = 6;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableParaList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedString getParaList() {
      return paraList;
    }

    /**
     * <code>repeated string para_list = 6;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedString getMutableParaList() {
      bitField0_ |= 0x00000200;
      return paraList;
    }

    /**
     * <code>repeated string para_list = 6;</code>
     * @param value the paraList to add
     * @return this
     */
    public ClientMail addParaList(final CharSequence value) {
      bitField0_ |= 0x00000200;
      paraList.add(value);
      return this;
    }

    /**
     * <code>repeated string para_list = 6;</code>
     * @param values the paraList to add
     * @return this
     */
    public ClientMail addAllParaList(final CharSequence... values) {
      bitField0_ |= 0x00000200;
      paraList.addAll(values);
      return this;
    }

    @Override
    public ClientMail copyFrom(final ClientMail other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        time = other.time;
        expireTime = other.expireTime;
        id = other.id;
        templateId = other.templateId;
        isRead = other.isRead;
        attachment.copyFrom(other.attachment);
        content.copyFrom(other.content);
        sender.copyFrom(other.sender);
        title.copyFrom(other.title);
        paraList.copyFrom(other.paraList);
      }
      return this;
    }

    @Override
    public ClientMail mergeFrom(final ClientMail other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasTime()) {
        setTime(other.time);
      }
      if (other.hasExpireTime()) {
        setExpireTime(other.expireTime);
      }
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasTemplateId()) {
        setTemplateId(other.templateId);
      }
      if (other.hasIsRead()) {
        setIsRead(other.isRead);
      }
      if (other.hasAttachment()) {
        getMutableAttachment().mergeFrom(other.attachment);
      }
      if (other.hasContent()) {
        getMutableContentBytes().copyFrom(other.content);
      }
      if (other.hasSender()) {
        getMutableSenderBytes().copyFrom(other.sender);
      }
      if (other.hasTitle()) {
        getMutableTitleBytes().copyFrom(other.title);
      }
      if (other.hasParaList()) {
        getMutableParaList().addAll(other.paraList);
      }
      return this;
    }

    @Override
    public ClientMail clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      time = 0L;
      expireTime = 0L;
      id = 0;
      templateId = 0;
      isRead = false;
      attachment.clear();
      content.clear();
      sender.clear();
      title.clear();
      paraList.clear();
      return this;
    }

    @Override
    public ClientMail clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      attachment.clearQuick();
      content.clear();
      sender.clear();
      title.clear();
      paraList.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ClientMail)) {
        return false;
      }
      ClientMail other = (ClientMail) o;
      return bitField0_ == other.bitField0_
        && (!hasTime() || time == other.time)
        && (!hasExpireTime() || expireTime == other.expireTime)
        && (!hasId() || id == other.id)
        && (!hasTemplateId() || templateId == other.templateId)
        && (!hasIsRead() || isRead == other.isRead)
        && (!hasAttachment() || attachment.equals(other.attachment))
        && (!hasContent() || content.equals(other.content))
        && (!hasSender() || sender.equals(other.sender))
        && (!hasTitle() || title.equals(other.title))
        && (!hasParaList() || paraList.equals(other.paraList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeInt64NoTag(time);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 56);
        output.writeInt64NoTag(expireTime);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(id);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 80);
        output.writeUInt32NoTag(templateId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 24);
        output.writeBoolNoTag(isRead);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 122);
        output.writeMessageNoTag(attachment);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 34);
        output.writeStringNoTag(content);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 90);
        output.writeStringNoTag(sender);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawByte((byte) 98);
        output.writeStringNoTag(title);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        for (int i = 0; i < paraList.length(); i++) {
          output.writeRawByte((byte) 50);
          output.writeStringNoTag(paraList.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(time);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(expireTime);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(templateId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(attachment);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(content);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(sender);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(title);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += (1 * paraList.length()) + ProtoSink.computeRepeatedStringSizeNoTag(paraList);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public ClientMail mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // time
            time = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 56) {
              break;
            }
          }
          case 56: {
            // expireTime
            expireTime = input.readInt64();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 16) {
              break;
            }
          }
          case 16: {
            // id
            id = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 80) {
              break;
            }
          }
          case 80: {
            // templateId
            templateId = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // isRead
            isRead = input.readBool();
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // attachment
            input.readMessage(attachment);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 34) {
              break;
            }
          }
          case 34: {
            // content
            input.readString(content);
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 90) {
              break;
            }
          }
          case 90: {
            // sender
            input.readString(sender);
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 98) {
              break;
            }
          }
          case 98: {
            // title
            input.readString(title);
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // paraList
            tag = input.readRepeatedString(paraList, tag);
            bitField0_ |= 0x00000200;
            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.time, time);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeInt64(FieldNames.expireTime, expireTime);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.id, id);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.templateId, templateId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeBool(FieldNames.isRead, isRead);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeMessage(FieldNames.attachment, attachment);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeString(FieldNames.content, content);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeString(FieldNames.sender, sender);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeString(FieldNames.title, title);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRepeatedString(FieldNames.paraList, paraList);
      }
      output.endObject();
    }

    @Override
    public ClientMail mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3560141: {
            if (input.isAtField(FieldNames.time)) {
              if (!input.trySkipNullValue()) {
                time = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -834724724:
          case -96179731: {
            if (input.isAtField(FieldNames.expireTime)) {
              if (!input.trySkipNullValue()) {
                expireTime = input.readInt64();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3355: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1304010549:
          case 1769642752: {
            if (input.isAtField(FieldNames.templateId)) {
              if (!input.trySkipNullValue()) {
                templateId = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1180158496:
          case 2082189195: {
            if (input.isAtField(FieldNames.isRead)) {
              if (!input.trySkipNullValue()) {
                isRead = input.readBool();
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1963501277: {
            if (input.isAtField(FieldNames.attachment)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(attachment);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 951530617: {
            if (input.isAtField(FieldNames.content)) {
              if (!input.trySkipNullValue()) {
                input.readString(content);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -905962955: {
            if (input.isAtField(FieldNames.sender)) {
              if (!input.trySkipNullValue()) {
                input.readString(sender);
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 110371416: {
            if (input.isAtField(FieldNames.title)) {
              if (!input.trySkipNullValue()) {
                input.readString(title);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1170446494:
          case 1941729693: {
            if (input.isAtField(FieldNames.paraList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedString(paraList);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum ClientMailFactory implements MessageFactory<ClientMail> {
      INSTANCE;

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

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

      static final FieldName expireTime = FieldName.forField("expireTime", "expire_time");

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

      static final FieldName templateId = FieldName.forField("templateId", "template_id");

      static final FieldName isRead = FieldName.forField("isRead", "is_read");

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

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

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

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

      static final FieldName paraList = FieldName.forField("paraList", "para_list");
    }
  }
}
