// 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.ProtoEnum;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.ProtoUtil;
import us.hebi.quickbuf.RepeatedInt;
import us.hebi.quickbuf.RepeatedMessage;
import us.hebi.quickbuf.Utf8String;

public final class Pb {
  /**
   * Protobuf enum {@code Platform}
   */
  public enum Platform implements ProtoEnum<Platform> {
    /**
     * <code>All = 0;</code>
     */
    All("All", 0),

    /**
     * <code>Ios = 1;</code>
     */
    Ios("Ios", 1),

    /**
     * <code>Android = 2;</code>
     */
    Android("Android", 2),

    /**
     * <code>Pc = 3;</code>
     */
    Pc("Pc", 3),

    /**
     * <code>Harmonyos = 4;</code>
     */
    Harmonyos("Harmonyos", 4);

    /**
     * <code>All = 0;</code>
     */
    public static final int All_VALUE = 0;

    /**
     * <code>Ios = 1;</code>
     */
    public static final int Ios_VALUE = 1;

    /**
     * <code>Android = 2;</code>
     */
    public static final int Android_VALUE = 2;

    /**
     * <code>Pc = 3;</code>
     */
    public static final int Pc_VALUE = 3;

    /**
     * <code>Harmonyos = 4;</code>
     */
    public static final int Harmonyos_VALUE = 4;

    private final String name;

    private final int number;

    private Platform(String name, int number) {
      this.name = name;
      this.number = number;
    }

    /**
     * @return the string representation of enum entry
     */
    @Override
    public String getName() {
      return name;
    }

    /**
     * @return the numeric wire value of this enum entry
     */
    @Override
    public int getNumber() {
      return number;
    }

    /**
     * @return a converter that maps between this enum's numeric and text representations
     */
    public static ProtoEnum.EnumConverter<Platform> converter() {
      return PlatformConverter.INSTANCE;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value, or null if unknown.
     */
    public static Platform forNumber(int value) {
      return PlatformConverter.INSTANCE.forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @param other Fallback value in case the value is not known.
     * @return The enum associated with the given numeric wire value, or the fallback value if unknown.
     */
    public static Platform forNumberOr(int number, Platform other) {
      Platform value = forNumber(number);
      return value == null ? other : value;
    }

    enum PlatformConverter implements ProtoEnum.EnumConverter<Platform> {
      INSTANCE;

      private static final Platform[] lookup = new Platform[5];

      static {
        lookup[0] = All;
        lookup[1] = Ios;
        lookup[2] = Android;
        lookup[3] = Pc;
        lookup[4] = Harmonyos;
      }

      @Override
      public final Platform forNumber(final int value) {
        if (value >= 0 && value < lookup.length) {
          return lookup[value];
        }
        return null;
      }

      @Override
      public final Platform forName(final CharSequence value) {
        switch (value.length()) {
          case 2: {
            if (ProtoUtil.isEqual("Pc", value)) {
              return Pc;
            }
            break;
          }
          case 3: {
            if (ProtoUtil.isEqual("All", value)) {
              return All;
            }
            if (ProtoUtil.isEqual("Ios", value)) {
              return Ios;
            }
            break;
          }
          case 7: {
            if (ProtoUtil.isEqual("Android", value)) {
              return Android;
            }
            break;
          }
          case 9: {
            if (ProtoUtil.isEqual("Harmonyos", value)) {
              return Harmonyos;
            }
            break;
          }
        }
        return null;
      }
    }
  }

  /**
   * Protobuf enum {@code OP}
   */
  public enum OP implements ProtoEnum<OP> {
    /**
     * <code>Eq = 0;</code>
     */
    Eq("Eq", 0),

    /**
     * <code>Lt = 1;</code>
     */
    Lt("Lt", 1),

    /**
     * <code>Gt = 2;</code>
     */
    Gt("Gt", 2),

    /**
     * <code>Le = 3;</code>
     */
    Le("Le", 3),

    /**
     * <code>Ge = 4;</code>
     */
    Ge("Ge", 4);

    /**
     * <code>Eq = 0;</code>
     */
    public static final int Eq_VALUE = 0;

    /**
     * <code>Lt = 1;</code>
     */
    public static final int Lt_VALUE = 1;

    /**
     * <code>Gt = 2;</code>
     */
    public static final int Gt_VALUE = 2;

    /**
     * <code>Le = 3;</code>
     */
    public static final int Le_VALUE = 3;

    /**
     * <code>Ge = 4;</code>
     */
    public static final int Ge_VALUE = 4;

    private final String name;

    private final int number;

    private OP(String name, int number) {
      this.name = name;
      this.number = number;
    }

    /**
     * @return the string representation of enum entry
     */
    @Override
    public String getName() {
      return name;
    }

    /**
     * @return the numeric wire value of this enum entry
     */
    @Override
    public int getNumber() {
      return number;
    }

    /**
     * @return a converter that maps between this enum's numeric and text representations
     */
    public static ProtoEnum.EnumConverter<OP> converter() {
      return OPConverter.INSTANCE;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value, or null if unknown.
     */
    public static OP forNumber(int value) {
      return OPConverter.INSTANCE.forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @param other Fallback value in case the value is not known.
     * @return The enum associated with the given numeric wire value, or the fallback value if unknown.
     */
    public static OP forNumberOr(int number, OP other) {
      OP value = forNumber(number);
      return value == null ? other : value;
    }

    enum OPConverter implements ProtoEnum.EnumConverter<OP> {
      INSTANCE;

      private static final OP[] lookup = new OP[5];

      static {
        lookup[0] = Eq;
        lookup[1] = Lt;
        lookup[2] = Gt;
        lookup[3] = Le;
        lookup[4] = Ge;
      }

      @Override
      public final OP forNumber(final int value) {
        if (value >= 0 && value < lookup.length) {
          return lookup[value];
        }
        return null;
      }

      @Override
      public final OP forName(final CharSequence value) {
        if (value.length() == 2) {
          if (ProtoUtil.isEqual("Eq", value)) {
            return Eq;
          }
          if (ProtoUtil.isEqual("Lt", value)) {
            return Lt;
          }
          if (ProtoUtil.isEqual("Gt", value)) {
            return Gt;
          }
          if (ProtoUtil.isEqual("Le", value)) {
            return Le;
          }
          if (ProtoUtil.isEqual("Ge", value)) {
            return Ge;
          }
        }
        return null;
      }
    }
  }

  /**
   * Protobuf enum {@code Action}
   */
  public enum Action implements ProtoEnum<Action> {
    /**
     * <code>Redirect = 0;</code>
     */
    Redirect("Redirect", 0),

    /**
     * <code>Download = 1;</code>
     */
    Download("Download", 1);

    /**
     * <code>Redirect = 0;</code>
     */
    public static final int Redirect_VALUE = 0;

    /**
     * <code>Download = 1;</code>
     */
    public static final int Download_VALUE = 1;

    private final String name;

    private final int number;

    private Action(String name, int number) {
      this.name = name;
      this.number = number;
    }

    /**
     * @return the string representation of enum entry
     */
    @Override
    public String getName() {
      return name;
    }

    /**
     * @return the numeric wire value of this enum entry
     */
    @Override
    public int getNumber() {
      return number;
    }

    /**
     * @return a converter that maps between this enum's numeric and text representations
     */
    public static ProtoEnum.EnumConverter<Action> converter() {
      return ActionConverter.INSTANCE;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value, or null if unknown.
     */
    public static Action forNumber(int value) {
      return ActionConverter.INSTANCE.forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @param other Fallback value in case the value is not known.
     * @return The enum associated with the given numeric wire value, or the fallback value if unknown.
     */
    public static Action forNumberOr(int number, Action other) {
      Action value = forNumber(number);
      return value == null ? other : value;
    }

    enum ActionConverter implements ProtoEnum.EnumConverter<Action> {
      INSTANCE;

      private static final Action[] lookup = new Action[2];

      static {
        lookup[0] = Redirect;
        lookup[1] = Download;
      }

      @Override
      public final Action forNumber(final int value) {
        if (value >= 0 && value < lookup.length) {
          return lookup[value];
        }
        return null;
      }

      @Override
      public final Action forName(final CharSequence value) {
        if (value.length() == 8) {
          if (ProtoUtil.isEqual("Redirect", value)) {
            return Redirect;
          }
          if (ProtoUtil.isEqual("Download", value)) {
            return Download;
          }
        }
        return null;
      }
    }
  }

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

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

    /**
     * <code>optional sint32 status = 3;</code>
     */
    private int status;

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

    /**
     * <code>optional string report_endpoint = 6;</code>
     */
    private final Utf8String reportEndpoint = Utf8String.newEmptyInstance();

    /**
     * <code>repeated .pb.ServerAgent agent = 2;</code>
     */
    private final RepeatedMessage<ServerAgent> agent = RepeatedMessage.newEmptyInstance(ServerAgent.getFactory());

    /**
     * <code>repeated .pb.Rule rules = 7;</code>
     */
    private final RepeatedMessage<Rule> rules = RepeatedMessage.newEmptyInstance(Rule.getFactory());

    private ServerListMeta() {
    }

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

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

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

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

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

    /**
     * <code>optional sint32 status = 3;</code>
     * @return whether the status field is set
     */
    public boolean hasStatus() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional sint32 status = 3;</code>
     * @return this
     */
    public ServerListMeta clearStatus() {
      bitField0_ &= ~0x00000002;
      status = 0;
      return this;
    }

    /**
     * <code>optional sint32 status = 3;</code>
     * @return the status
     */
    public int getStatus() {
      return status;
    }

    /**
     * <code>optional sint32 status = 3;</code>
     * @param value the status to set
     * @return this
     */
    public ServerListMeta setStatus(final int value) {
      bitField0_ |= 0x00000002;
      status = value;
      return this;
    }

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

    /**
     * <code>optional string message = 4;</code>
     * @return this
     */
    public ServerListMeta clearMessage() {
      bitField0_ &= ~0x00000004;
      message.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string message = 4;</code>
     * @param value the message to set
     * @return this
     */
    public ServerListMeta setMessage(final CharSequence value) {
      bitField0_ |= 0x00000004;
      message.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string message = 4;</code>
     * @param value the message to set
     * @return this
     */
    public ServerListMeta setMessage(final Utf8String value) {
      bitField0_ |= 0x00000004;
      message.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @return whether the reportEndpoint field is set
     */
    public boolean hasReportEndpoint() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @return this
     */
    public ServerListMeta clearReportEndpoint() {
      bitField0_ &= ~0x00000008;
      reportEndpoint.clear();
      return this;
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @return the reportEndpoint
     */
    public String getReportEndpoint() {
      return reportEndpoint.getString();
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @return internal {@code Utf8String} representation of reportEndpoint for reading
     */
    public Utf8String getReportEndpointBytes() {
      return this.reportEndpoint;
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @return internal {@code Utf8String} representation of reportEndpoint for modifications
     */
    public Utf8String getMutableReportEndpointBytes() {
      bitField0_ |= 0x00000008;
      return this.reportEndpoint;
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @param value the reportEndpoint to set
     * @return this
     */
    public ServerListMeta setReportEndpoint(final CharSequence value) {
      bitField0_ |= 0x00000008;
      reportEndpoint.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string report_endpoint = 6;</code>
     * @param value the reportEndpoint to set
     * @return this
     */
    public ServerListMeta setReportEndpoint(final Utf8String value) {
      bitField0_ |= 0x00000008;
      reportEndpoint.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated .pb.ServerAgent agent = 2;</code>
     * @return whether the agent field is set
     */
    public boolean hasAgent() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>repeated .pb.ServerAgent agent = 2;</code>
     * @return this
     */
    public ServerListMeta clearAgent() {
      bitField0_ &= ~0x00000010;
      agent.clear();
      return this;
    }

    /**
     * <code>repeated .pb.ServerAgent agent = 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 #getMutableAgent()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<ServerAgent> getAgent() {
      return agent;
    }

    /**
     * <code>repeated .pb.ServerAgent agent = 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 RepeatedMessage<ServerAgent> getMutableAgent() {
      bitField0_ |= 0x00000010;
      return agent;
    }

    /**
     * <code>repeated .pb.ServerAgent agent = 2;</code>
     * @param value the agent to add
     * @return this
     */
    public ServerListMeta addAgent(final ServerAgent value) {
      bitField0_ |= 0x00000010;
      agent.add(value);
      return this;
    }

    /**
     * <code>repeated .pb.ServerAgent agent = 2;</code>
     * @param values the agent to add
     * @return this
     */
    public ServerListMeta addAllAgent(final ServerAgent... values) {
      bitField0_ |= 0x00000010;
      agent.addAll(values);
      return this;
    }

    /**
     * <code>repeated .pb.Rule rules = 7;</code>
     * @return whether the rules field is set
     */
    public boolean hasRules() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>repeated .pb.Rule rules = 7;</code>
     * @return this
     */
    public ServerListMeta clearRules() {
      bitField0_ &= ~0x00000020;
      rules.clear();
      return this;
    }

    /**
     * <code>repeated .pb.Rule rules = 7;</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 #getMutableRules()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<Rule> getRules() {
      return rules;
    }

    /**
     * <code>repeated .pb.Rule rules = 7;</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<Rule> getMutableRules() {
      bitField0_ |= 0x00000020;
      return rules;
    }

    /**
     * <code>repeated .pb.Rule rules = 7;</code>
     * @param value the rules to add
     * @return this
     */
    public ServerListMeta addRules(final Rule value) {
      bitField0_ |= 0x00000020;
      rules.add(value);
      return this;
    }

    /**
     * <code>repeated .pb.Rule rules = 7;</code>
     * @param values the rules to add
     * @return this
     */
    public ServerListMeta addAllRules(final Rule... values) {
      bitField0_ |= 0x00000020;
      rules.addAll(values);
      return this;
    }

    @Override
    public ServerListMeta copyFrom(final ServerListMeta other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        version = other.version;
        status = other.status;
        message.copyFrom(other.message);
        reportEndpoint.copyFrom(other.reportEndpoint);
        agent.copyFrom(other.agent);
        rules.copyFrom(other.rules);
      }
      return this;
    }

    @Override
    public ServerListMeta mergeFrom(final ServerListMeta other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasVersion()) {
        setVersion(other.version);
      }
      if (other.hasStatus()) {
        setStatus(other.status);
      }
      if (other.hasMessage()) {
        getMutableMessageBytes().copyFrom(other.message);
      }
      if (other.hasReportEndpoint()) {
        getMutableReportEndpointBytes().copyFrom(other.reportEndpoint);
      }
      if (other.hasAgent()) {
        getMutableAgent().addAll(other.agent);
      }
      if (other.hasRules()) {
        getMutableRules().addAll(other.rules);
      }
      return this;
    }

    @Override
    public ServerListMeta clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      version = 0L;
      status = 0;
      message.clear();
      reportEndpoint.clear();
      agent.clear();
      rules.clear();
      return this;
    }

    @Override
    public ServerListMeta clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      message.clear();
      reportEndpoint.clear();
      agent.clearQuick();
      rules.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ServerListMeta)) {
        return false;
      }
      ServerListMeta other = (ServerListMeta) o;
      return bitField0_ == other.bitField0_
        && (!hasVersion() || version == other.version)
        && (!hasStatus() || status == other.status)
        && (!hasMessage() || message.equals(other.message))
        && (!hasReportEndpoint() || reportEndpoint.equals(other.reportEndpoint))
        && (!hasAgent() || agent.equals(other.agent))
        && (!hasRules() || rules.equals(other.rules));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeInt64NoTag(version);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 24);
        output.writeSInt32NoTag(status);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 34);
        output.writeStringNoTag(message);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 50);
        output.writeStringNoTag(reportEndpoint);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        for (int i = 0; i < agent.length(); i++) {
          output.writeRawByte((byte) 18);
          output.writeMessageNoTag(agent.get(i));
        }
      }
      if ((bitField0_ & 0x00000020) != 0) {
        for (int i = 0; i < rules.length(); i++) {
          output.writeRawByte((byte) 58);
          output.writeMessageNoTag(rules.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(version);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeSInt32SizeNoTag(status);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(message);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(reportEndpoint);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += (1 * agent.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(agent);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += (1 * rules.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(rules);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public ServerListMeta mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // version
            version = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // status
            status = input.readSInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 34) {
              break;
            }
          }
          case 34: {
            // message
            input.readString(message);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // reportEndpoint
            input.readString(reportEndpoint);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // agent
            tag = input.readRepeatedMessage(agent, tag);
            bitField0_ |= 0x00000010;
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // rules
            tag = input.readRepeatedMessage(rules, tag);
            bitField0_ |= 0x00000020;
            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.version, version);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeSInt32(FieldNames.status, status);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeString(FieldNames.message, message);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeString(FieldNames.reportEndpoint, reportEndpoint);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRepeatedMessage(FieldNames.agent, agent);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRepeatedMessage(FieldNames.rules, rules);
      }
      output.endObject();
    }

    @Override
    public ServerListMeta mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 351608024: {
            if (input.isAtField(FieldNames.version)) {
              if (!input.trySkipNullValue()) {
                version = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -892481550: {
            if (input.isAtField(FieldNames.status)) {
              if (!input.trySkipNullValue()) {
                status = input.readSInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 954925063: {
            if (input.isAtField(FieldNames.message)) {
              if (!input.trySkipNullValue()) {
                input.readString(message);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -22060311:
          case 1004180544: {
            if (input.isAtField(FieldNames.reportEndpoint)) {
              if (!input.trySkipNullValue()) {
                input.readString(reportEndpoint);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 92750597: {
            if (input.isAtField(FieldNames.agent)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(agent);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 108873975: {
            if (input.isAtField(FieldNames.rules)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(rules);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum ServerListMetaFactory implements MessageFactory<ServerListMeta> {
      INSTANCE;

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

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

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

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

      static final FieldName reportEndpoint = FieldName.forField("reportEndpoint", "report_endpoint");

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

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

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

    /**
     * <code>optional int64 zone = 4;</code>
     */
    private long zone;

    /**
     * <code>optional int32 status = 3;</code>
     */
    private int status;

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

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

    private ServerAgent() {
    }

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

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

    /**
     * <code>optional int64 zone = 4;</code>
     * @return this
     */
    public ServerAgent clearZone() {
      bitField0_ &= ~0x00000001;
      zone = 0L;
      return this;
    }

    /**
     * <code>optional int64 zone = 4;</code>
     * @return the zone
     */
    public long getZone() {
      return zone;
    }

    /**
     * <code>optional int64 zone = 4;</code>
     * @param value the zone to set
     * @return this
     */
    public ServerAgent setZone(final long value) {
      bitField0_ |= 0x00000001;
      zone = value;
      return this;
    }

    /**
     * <code>optional int32 status = 3;</code>
     * @return whether the status field is set
     */
    public boolean hasStatus() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional int32 status = 3;</code>
     * @return this
     */
    public ServerAgent clearStatus() {
      bitField0_ &= ~0x00000002;
      status = 0;
      return this;
    }

    /**
     * <code>optional int32 status = 3;</code>
     * @return the status
     */
    public int getStatus() {
      return status;
    }

    /**
     * <code>optional int32 status = 3;</code>
     * @param value the status to set
     * @return this
     */
    public ServerAgent setStatus(final int value) {
      bitField0_ |= 0x00000002;
      status = value;
      return this;
    }

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

    /**
     * <code>optional string name = 1;</code>
     * @return this
     */
    public ServerAgent clearName() {
      bitField0_ &= ~0x00000004;
      name.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string name = 1;</code>
     * @param value the name to set
     * @return this
     */
    public ServerAgent setName(final CharSequence value) {
      bitField0_ |= 0x00000004;
      name.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string name = 1;</code>
     * @param value the name to set
     * @return this
     */
    public ServerAgent setName(final Utf8String value) {
      bitField0_ |= 0x00000004;
      name.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string addr = 2;</code>
     * @return whether the addr field is set
     */
    public boolean hasAddr() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional string addr = 2;</code>
     * @return this
     */
    public ServerAgent clearAddr() {
      bitField0_ &= ~0x00000008;
      addr.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string addr = 2;</code>
     * @param value the addr to set
     * @return this
     */
    public ServerAgent setAddr(final CharSequence value) {
      bitField0_ |= 0x00000008;
      addr.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string addr = 2;</code>
     * @param value the addr to set
     * @return this
     */
    public ServerAgent setAddr(final Utf8String value) {
      bitField0_ |= 0x00000008;
      addr.copyFrom(value);
      return this;
    }

    @Override
    public ServerAgent copyFrom(final ServerAgent other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        zone = other.zone;
        status = other.status;
        name.copyFrom(other.name);
        addr.copyFrom(other.addr);
      }
      return this;
    }

    @Override
    public ServerAgent mergeFrom(final ServerAgent other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasZone()) {
        setZone(other.zone);
      }
      if (other.hasStatus()) {
        setStatus(other.status);
      }
      if (other.hasName()) {
        getMutableNameBytes().copyFrom(other.name);
      }
      if (other.hasAddr()) {
        getMutableAddrBytes().copyFrom(other.addr);
      }
      return this;
    }

    @Override
    public ServerAgent clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      zone = 0L;
      status = 0;
      name.clear();
      addr.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ServerAgent)) {
        return false;
      }
      ServerAgent other = (ServerAgent) o;
      return bitField0_ == other.bitField0_
        && (!hasZone() || zone == other.zone)
        && (!hasStatus() || status == other.status)
        && (!hasName() || name.equals(other.name))
        && (!hasAddr() || addr.equals(other.addr));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 32);
        output.writeInt64NoTag(zone);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 24);
        output.writeInt32NoTag(status);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 10);
        output.writeStringNoTag(name);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 18);
        output.writeStringNoTag(addr);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(zone);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeInt32SizeNoTag(status);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(name);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(addr);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public ServerAgent mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 32: {
            // zone
            zone = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // status
            status = input.readInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 10) {
              break;
            }
          }
          case 10: {
            // name
            input.readString(name);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // addr
            input.readString(addr);
            bitField0_ |= 0x00000008;
            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.writeInt64(FieldNames.zone, zone);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeInt32(FieldNames.status, status);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeString(FieldNames.name, name);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeString(FieldNames.addr, addr);
      }
      output.endObject();
    }

    @Override
    public ServerAgent mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3744684: {
            if (input.isAtField(FieldNames.zone)) {
              if (!input.trySkipNullValue()) {
                zone = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -892481550: {
            if (input.isAtField(FieldNames.status)) {
              if (!input.trySkipNullValue()) {
                status = input.readInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3373707: {
            if (input.isAtField(FieldNames.name)) {
              if (!input.trySkipNullValue()) {
                input.readString(name);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2989041: {
            if (input.isAtField(FieldNames.addr)) {
              if (!input.trySkipNullValue()) {
                input.readString(addr);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum ServerAgentFactory implements MessageFactory<ServerAgent> {
      INSTANCE;

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

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

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

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

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

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

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     */
    private final RepeatedMessage<FileDiff> diff = RepeatedMessage.newEmptyInstance(FileDiff.getFactory());

    private ClientDiff() {
    }

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

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     * @return whether the diff field is set
     */
    public boolean hasDiff() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     * @return this
     */
    public ClientDiff clearDiff() {
      bitField0_ &= ~0x00000001;
      diff.clear();
      return this;
    }

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableDiff()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<FileDiff> getDiff() {
      return diff;
    }

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedMessage<FileDiff> getMutableDiff() {
      bitField0_ |= 0x00000001;
      return diff;
    }

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     * @param value the diff to add
     * @return this
     */
    public ClientDiff addDiff(final FileDiff value) {
      bitField0_ |= 0x00000001;
      diff.add(value);
      return this;
    }

    /**
     * <code>repeated .pb.FileDiff diff = 1;</code>
     * @param values the diff to add
     * @return this
     */
    public ClientDiff addAllDiff(final FileDiff... values) {
      bitField0_ |= 0x00000001;
      diff.addAll(values);
      return this;
    }

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

    @Override
    public ClientDiff mergeFrom(final ClientDiff other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasDiff()) {
        getMutableDiff().addAll(other.diff);
      }
      return this;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ClientDiff)) {
        return false;
      }
      ClientDiff other = (ClientDiff) o;
      return bitField0_ == other.bitField0_
        && (!hasDiff() || diff.equals(other.diff));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        for (int i = 0; i < diff.length(); i++) {
          output.writeRawByte((byte) 10);
          output.writeMessageNoTag(diff.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += (1 * diff.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(diff);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public ClientDiff mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 10: {
            // diff
            tag = input.readRepeatedMessage(diff, tag);
            bitField0_ |= 0x00000001;
            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.writeRepeatedMessage(FieldNames.diff, diff);
      }
      output.endObject();
    }

    @Override
    public ClientDiff mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3083269: {
            if (input.isAtField(FieldNames.diff)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(diff);
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum ClientDiffFactory implements MessageFactory<ClientDiff> {
      INSTANCE;

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

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

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

    /**
     * <code>optional int64 version = 3;</code>
     */
    private long version;

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

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

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

    private FileDiff() {
    }

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

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

    /**
     * <code>optional int64 version = 3;</code>
     * @return this
     */
    public FileDiff clearVersion() {
      bitField0_ &= ~0x00000001;
      version = 0L;
      return this;
    }

    /**
     * <code>optional int64 version = 3;</code>
     * @return the version
     */
    public long getVersion() {
      return version;
    }

    /**
     * <code>optional int64 version = 3;</code>
     * @param value the version to set
     * @return this
     */
    public FileDiff setVersion(final long value) {
      bitField0_ |= 0x00000001;
      version = value;
      return this;
    }

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

    /**
     * <code>optional string file_name = 1;</code>
     * @return this
     */
    public FileDiff clearFileName() {
      bitField0_ &= ~0x00000002;
      fileName.clear();
      return this;
    }

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

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

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

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

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

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

    /**
     * <code>optional string hash = 2;</code>
     * @return this
     */
    public FileDiff clearHash() {
      bitField0_ &= ~0x00000004;
      hash.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string hash = 2;</code>
     * @param value the hash to set
     * @return this
     */
    public FileDiff setHash(final CharSequence value) {
      bitField0_ |= 0x00000004;
      hash.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string hash = 2;</code>
     * @param value the hash to set
     * @return this
     */
    public FileDiff setHash(final Utf8String value) {
      bitField0_ |= 0x00000004;
      hash.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string additional_path = 4;</code>
     * @return whether the additionalPath field is set
     */
    public boolean hasAdditionalPath() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional string additional_path = 4;</code>
     * @return this
     */
    public FileDiff clearAdditionalPath() {
      bitField0_ &= ~0x00000008;
      additionalPath.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string additional_path = 4;</code>
     * @param value the additionalPath to set
     * @return this
     */
    public FileDiff setAdditionalPath(final CharSequence value) {
      bitField0_ |= 0x00000008;
      additionalPath.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string additional_path = 4;</code>
     * @param value the additionalPath to set
     * @return this
     */
    public FileDiff setAdditionalPath(final Utf8String value) {
      bitField0_ |= 0x00000008;
      additionalPath.copyFrom(value);
      return this;
    }

    @Override
    public FileDiff copyFrom(final FileDiff other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        version = other.version;
        fileName.copyFrom(other.fileName);
        hash.copyFrom(other.hash);
        additionalPath.copyFrom(other.additionalPath);
      }
      return this;
    }

    @Override
    public FileDiff mergeFrom(final FileDiff other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasVersion()) {
        setVersion(other.version);
      }
      if (other.hasFileName()) {
        getMutableFileNameBytes().copyFrom(other.fileName);
      }
      if (other.hasHash()) {
        getMutableHashBytes().copyFrom(other.hash);
      }
      if (other.hasAdditionalPath()) {
        getMutableAdditionalPathBytes().copyFrom(other.additionalPath);
      }
      return this;
    }

    @Override
    public FileDiff clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      version = 0L;
      fileName.clear();
      hash.clear();
      additionalPath.clear();
      return this;
    }

    @Override
    public FileDiff clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      fileName.clear();
      hash.clear();
      additionalPath.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof FileDiff)) {
        return false;
      }
      FileDiff other = (FileDiff) o;
      return bitField0_ == other.bitField0_
        && (!hasVersion() || version == other.version)
        && (!hasFileName() || fileName.equals(other.fileName))
        && (!hasHash() || hash.equals(other.hash))
        && (!hasAdditionalPath() || additionalPath.equals(other.additionalPath));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 24);
        output.writeInt64NoTag(version);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 10);
        output.writeStringNoTag(fileName);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 18);
        output.writeStringNoTag(hash);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 34);
        output.writeStringNoTag(additionalPath);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(version);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(fileName);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(hash);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(additionalPath);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public FileDiff mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 24: {
            // version
            version = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 10) {
              break;
            }
          }
          case 10: {
            // fileName
            input.readString(fileName);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // hash
            input.readString(hash);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 34) {
              break;
            }
          }
          case 34: {
            // additionalPath
            input.readString(additionalPath);
            bitField0_ |= 0x00000008;
            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.writeInt64(FieldNames.version, version);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeString(FieldNames.fileName, fileName);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeString(FieldNames.hash, hash);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeString(FieldNames.additionalPath, additionalPath);
      }
      output.endObject();
    }

    @Override
    public FileDiff mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 351608024: {
            if (input.isAtField(FieldNames.version)) {
              if (!input.trySkipNullValue()) {
                version = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -735721945:
          case -1316467858: {
            if (input.isAtField(FieldNames.fileName)) {
              if (!input.trySkipNullValue()) {
                input.readString(fileName);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3195150: {
            if (input.isAtField(FieldNames.hash)) {
              if (!input.trySkipNullValue()) {
                input.readString(hash);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -974101268:
          case -118086339: {
            if (input.isAtField(FieldNames.additionalPath)) {
              if (!input.trySkipNullValue()) {
                input.readString(additionalPath);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum FileDiffFactory implements MessageFactory<FileDiff> {
      INSTANCE;

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

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

      static final FieldName fileName = FieldName.forField("fileName", "file_name");

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

      static final FieldName additionalPath = FieldName.forField("additionalPath", "additional_path");
    }
  }

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

    /**
     * <code>optional .pb.Platform platform = 1;</code>
     */
    private int platform;

    /**
     * <code>optional .pb.OP op = 4;</code>
     */
    private int op;

    /**
     * <code>optional .pb.Action action = 5;</code>
     */
    private int action;

    /**
     * <code>optional bool enable = 7;</code>
     */
    private boolean enable;

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

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

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

    private Rule() {
    }

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

    /**
     * <code>optional .pb.Platform platform = 1;</code>
     * @return whether the platform field is set
     */
    public boolean hasPlatform() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional .pb.Platform platform = 1;</code>
     * @return this
     */
    public Rule clearPlatform() {
      bitField0_ &= ~0x00000001;
      platform = 0;
      return this;
    }

    /**
     * <code>optional .pb.Platform platform = 1;</code>
     * @return the platform
     */
    public Platform getPlatform() {
      return Platform.forNumber(platform);
    }

    /**
     * Gets the value of the internal enum store. The result is
     * equivalent to {@link Rule#getPlatform()}.getNumber().
     *
     * @return numeric wire representation
     */
    public int getPlatformValue() {
      return platform;
    }

    /**
     * Sets the value of the internal enum store. This does not
     * do any validity checks, so be sure to use appropriate value
     * constants from {@link Platform}. Setting an invalid value
     * can cause {@link Rule#getPlatform()} to return null
     *
     * @param value the numeric wire value to set
     * @return this
     */
    public Rule setPlatformValue(final int value) {
      bitField0_ |= 0x00000001;
      platform = value;
      return this;
    }

    /**
     * <code>optional .pb.Platform platform = 1;</code>
     * @param value the platform to set
     * @return this
     */
    public Rule setPlatform(final Platform value) {
      bitField0_ |= 0x00000001;
      platform = value.getNumber();
      return this;
    }

    /**
     * <code>optional .pb.OP op = 4;</code>
     * @return whether the op field is set
     */
    public boolean hasOp() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .pb.OP op = 4;</code>
     * @return this
     */
    public Rule clearOp() {
      bitField0_ &= ~0x00000002;
      op = 0;
      return this;
    }

    /**
     * <code>optional .pb.OP op = 4;</code>
     * @return the op
     */
    public OP getOp() {
      return OP.forNumber(op);
    }

    /**
     * Gets the value of the internal enum store. The result is
     * equivalent to {@link Rule#getOp()}.getNumber().
     *
     * @return numeric wire representation
     */
    public int getOpValue() {
      return op;
    }

    /**
     * Sets the value of the internal enum store. This does not
     * do any validity checks, so be sure to use appropriate value
     * constants from {@link OP}. Setting an invalid value
     * can cause {@link Rule#getOp()} to return null
     *
     * @param value the numeric wire value to set
     * @return this
     */
    public Rule setOpValue(final int value) {
      bitField0_ |= 0x00000002;
      op = value;
      return this;
    }

    /**
     * <code>optional .pb.OP op = 4;</code>
     * @param value the op to set
     * @return this
     */
    public Rule setOp(final OP value) {
      bitField0_ |= 0x00000002;
      op = value.getNumber();
      return this;
    }

    /**
     * <code>optional .pb.Action action = 5;</code>
     * @return whether the action field is set
     */
    public boolean hasAction() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional .pb.Action action = 5;</code>
     * @return this
     */
    public Rule clearAction() {
      bitField0_ &= ~0x00000004;
      action = 0;
      return this;
    }

    /**
     * <code>optional .pb.Action action = 5;</code>
     * @return the action
     */
    public Action getAction() {
      return Action.forNumber(action);
    }

    /**
     * Gets the value of the internal enum store. The result is
     * equivalent to {@link Rule#getAction()}.getNumber().
     *
     * @return numeric wire representation
     */
    public int getActionValue() {
      return action;
    }

    /**
     * Sets the value of the internal enum store. This does not
     * do any validity checks, so be sure to use appropriate value
     * constants from {@link Action}. Setting an invalid value
     * can cause {@link Rule#getAction()} to return null
     *
     * @param value the numeric wire value to set
     * @return this
     */
    public Rule setActionValue(final int value) {
      bitField0_ |= 0x00000004;
      action = value;
      return this;
    }

    /**
     * <code>optional .pb.Action action = 5;</code>
     * @param value the action to set
     * @return this
     */
    public Rule setAction(final Action value) {
      bitField0_ |= 0x00000004;
      action = value.getNumber();
      return this;
    }

    /**
     * <code>optional bool enable = 7;</code>
     * @return whether the enable field is set
     */
    public boolean hasEnable() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional bool enable = 7;</code>
     * @return this
     */
    public Rule clearEnable() {
      bitField0_ &= ~0x00000008;
      enable = false;
      return this;
    }

    /**
     * <code>optional bool enable = 7;</code>
     * @return the enable
     */
    public boolean getEnable() {
      return enable;
    }

    /**
     * <code>optional bool enable = 7;</code>
     * @param value the enable to set
     * @return this
     */
    public Rule setEnable(final boolean value) {
      bitField0_ |= 0x00000008;
      enable = value;
      return this;
    }

    /**
     * <code>optional string channel = 2;</code>
     * @return whether the channel field is set
     */
    public boolean hasChannel() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional string channel = 2;</code>
     * @return this
     */
    public Rule clearChannel() {
      bitField0_ &= ~0x00000010;
      channel.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string channel = 2;</code>
     * @param value the channel to set
     * @return this
     */
    public Rule setChannel(final CharSequence value) {
      bitField0_ |= 0x00000010;
      channel.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string channel = 2;</code>
     * @param value the channel to set
     * @return this
     */
    public Rule setChannel(final Utf8String value) {
      bitField0_ |= 0x00000010;
      channel.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string version = 3;</code>
     * @return whether the version field is set
     */
    public boolean hasVersion() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional string version = 3;</code>
     * @return this
     */
    public Rule clearVersion() {
      bitField0_ &= ~0x00000020;
      version.clear();
      return this;
    }

    /**
     * <code>optional string version = 3;</code>
     * @return the version
     */
    public String getVersion() {
      return version.getString();
    }

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

    /**
     * <code>optional string version = 3;</code>
     * @return internal {@code Utf8String} representation of version for modifications
     */
    public Utf8String getMutableVersionBytes() {
      bitField0_ |= 0x00000020;
      return this.version;
    }

    /**
     * <code>optional string version = 3;</code>
     * @param value the version to set
     * @return this
     */
    public Rule setVersion(final CharSequence value) {
      bitField0_ |= 0x00000020;
      version.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string version = 3;</code>
     * @param value the version to set
     * @return this
     */
    public Rule setVersion(final Utf8String value) {
      bitField0_ |= 0x00000020;
      version.copyFrom(value);
      return this;
    }

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

    /**
     * <code>optional string url = 6;</code>
     * @return this
     */
    public Rule clearUrl() {
      bitField0_ &= ~0x00000040;
      url.clear();
      return this;
    }

    /**
     * <code>optional string url = 6;</code>
     * @return the url
     */
    public String getUrl() {
      return url.getString();
    }

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

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

    /**
     * <code>optional string url = 6;</code>
     * @param value the url to set
     * @return this
     */
    public Rule setUrl(final CharSequence value) {
      bitField0_ |= 0x00000040;
      url.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string url = 6;</code>
     * @param value the url to set
     * @return this
     */
    public Rule setUrl(final Utf8String value) {
      bitField0_ |= 0x00000040;
      url.copyFrom(value);
      return this;
    }

    @Override
    public Rule copyFrom(final Rule other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        platform = other.platform;
        op = other.op;
        action = other.action;
        enable = other.enable;
        channel.copyFrom(other.channel);
        version.copyFrom(other.version);
        url.copyFrom(other.url);
      }
      return this;
    }

    @Override
    public Rule mergeFrom(final Rule other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasPlatform()) {
        setPlatformValue(other.platform);
      }
      if (other.hasOp()) {
        setOpValue(other.op);
      }
      if (other.hasAction()) {
        setActionValue(other.action);
      }
      if (other.hasEnable()) {
        setEnable(other.enable);
      }
      if (other.hasChannel()) {
        getMutableChannelBytes().copyFrom(other.channel);
      }
      if (other.hasVersion()) {
        getMutableVersionBytes().copyFrom(other.version);
      }
      if (other.hasUrl()) {
        getMutableUrlBytes().copyFrom(other.url);
      }
      return this;
    }

    @Override
    public Rule clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      platform = 0;
      op = 0;
      action = 0;
      enable = false;
      channel.clear();
      version.clear();
      url.clear();
      return this;
    }

    @Override
    public Rule clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      channel.clear();
      version.clear();
      url.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof Rule)) {
        return false;
      }
      Rule other = (Rule) o;
      return bitField0_ == other.bitField0_
        && (!hasPlatform() || platform == other.platform)
        && (!hasOp() || op == other.op)
        && (!hasAction() || action == other.action)
        && (!hasEnable() || enable == other.enable)
        && (!hasChannel() || channel.equals(other.channel))
        && (!hasVersion() || version.equals(other.version))
        && (!hasUrl() || url.equals(other.url));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeEnumNoTag(platform);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 32);
        output.writeEnumNoTag(op);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 40);
        output.writeEnumNoTag(action);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 56);
        output.writeBoolNoTag(enable);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 18);
        output.writeStringNoTag(channel);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 26);
        output.writeStringNoTag(version);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 50);
        output.writeStringNoTag(url);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(platform);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(op);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(action);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(channel);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(version);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(url);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public Rule mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // platform
            final int value = input.readInt32();
            if (Platform.forNumber(value) != null) {
              platform = value;
              bitField0_ |= 0x00000001;
            }
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // op
            final int value = input.readInt32();
            if (OP.forNumber(value) != null) {
              op = value;
              bitField0_ |= 0x00000002;
            }
            tag = input.readTag();
            if (tag != 40) {
              break;
            }
          }
          case 40: {
            // action
            final int value = input.readInt32();
            if (Action.forNumber(value) != null) {
              action = value;
              bitField0_ |= 0x00000004;
            }
            tag = input.readTag();
            if (tag != 56) {
              break;
            }
          }
          case 56: {
            // enable
            enable = input.readBool();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // channel
            input.readString(channel);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // version
            input.readString(version);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // url
            input.readString(url);
            bitField0_ |= 0x00000040;
            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.writeEnum(FieldNames.platform, platform, Platform.converter());
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeEnum(FieldNames.op, op, OP.converter());
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeEnum(FieldNames.action, action, Action.converter());
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeBool(FieldNames.enable, enable);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeString(FieldNames.channel, channel);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeString(FieldNames.version, version);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeString(FieldNames.url, url);
      }
      output.endObject();
    }

    @Override
    public Rule mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 1874684019: {
            if (input.isAtField(FieldNames.platform)) {
              if (!input.trySkipNullValue()) {
                final Platform value = input.readEnum(Platform.converter());
                if (value != null) {
                  platform = value.getNumber();
                  bitField0_ |= 0x00000001;
                } else {
                  input.skipUnknownEnumValue();
                }
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3553: {
            if (input.isAtField(FieldNames.op)) {
              if (!input.trySkipNullValue()) {
                final OP value = input.readEnum(OP.converter());
                if (value != null) {
                  op = value.getNumber();
                  bitField0_ |= 0x00000002;
                } else {
                  input.skipUnknownEnumValue();
                }
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1422950858: {
            if (input.isAtField(FieldNames.action)) {
              if (!input.trySkipNullValue()) {
                final Action value = input.readEnum(Action.converter());
                if (value != null) {
                  action = value.getNumber();
                  bitField0_ |= 0x00000004;
                } else {
                  input.skipUnknownEnumValue();
                }
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1298848381: {
            if (input.isAtField(FieldNames.enable)) {
              if (!input.trySkipNullValue()) {
                enable = input.readBool();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 738950403: {
            if (input.isAtField(FieldNames.channel)) {
              if (!input.trySkipNullValue()) {
                input.readString(channel);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 351608024: {
            if (input.isAtField(FieldNames.version)) {
              if (!input.trySkipNullValue()) {
                input.readString(version);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 116079: {
            if (input.isAtField(FieldNames.url)) {
              if (!input.trySkipNullValue()) {
                input.readString(url);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum RuleFactory implements MessageFactory<Rule> {
      INSTANCE;

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

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

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

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

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

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

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

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

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

    /**
     * <code>optional int64 end_time = 6;</code>
     */
    private long endTime;

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

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

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

    /**
     * <code>optional string content_url = 3;</code>
     */
    private final Utf8String contentUrl = Utf8String.newEmptyInstance();

    /**
     * <code>optional string quest_id = 5;</code>
     */
    private final Utf8String questId = Utf8String.newEmptyInstance();

    /**
     * <code>repeated uint32 channel = 4;</code>
     */
    private final RepeatedInt channel = RepeatedInt.newEmptyInstance();

    private NoticeItem() {
    }

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

    /**
     * <code>optional int64 end_time = 6;</code>
     * @return whether the endTime field is set
     */
    public boolean hasEndTime() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional int64 end_time = 6;</code>
     * @return this
     */
    public NoticeItem clearEndTime() {
      bitField0_ &= ~0x00000001;
      endTime = 0L;
      return this;
    }

    /**
     * <code>optional int64 end_time = 6;</code>
     * @return the endTime
     */
    public long getEndTime() {
      return endTime;
    }

    /**
     * <code>optional int64 end_time = 6;</code>
     * @param value the endTime to set
     * @return this
     */
    public NoticeItem setEndTime(final long value) {
      bitField0_ |= 0x00000001;
      endTime = value;
      return this;
    }

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

    /**
     * <code>optional int64 sort = 7;</code>
     * @return this
     */
    public NoticeItem clearSort() {
      bitField0_ &= ~0x00000002;
      sort = 0L;
      return this;
    }

    /**
     * <code>optional int64 sort = 7;</code>
     * @return the sort
     */
    public long getSort() {
      return sort;
    }

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

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

    /**
     * <code>optional uint64 id = 1;</code>
     * @return this
     */
    public NoticeItem clearId() {
      bitField0_ &= ~0x00000004;
      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 NoticeItem setId(final long value) {
      bitField0_ |= 0x00000004;
      id = value;
      return this;
    }

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

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

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

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

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

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

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

    /**
     * <code>optional string content_url = 3;</code>
     * @return whether the contentUrl field is set
     */
    public boolean hasContentUrl() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional string content_url = 3;</code>
     * @return this
     */
    public NoticeItem clearContentUrl() {
      bitField0_ &= ~0x00000010;
      contentUrl.clear();
      return this;
    }

    /**
     * <code>optional string content_url = 3;</code>
     * @return the contentUrl
     */
    public String getContentUrl() {
      return contentUrl.getString();
    }

    /**
     * <code>optional string content_url = 3;</code>
     * @return internal {@code Utf8String} representation of contentUrl for reading
     */
    public Utf8String getContentUrlBytes() {
      return this.contentUrl;
    }

    /**
     * <code>optional string content_url = 3;</code>
     * @return internal {@code Utf8String} representation of contentUrl for modifications
     */
    public Utf8String getMutableContentUrlBytes() {
      bitField0_ |= 0x00000010;
      return this.contentUrl;
    }

    /**
     * <code>optional string content_url = 3;</code>
     * @param value the contentUrl to set
     * @return this
     */
    public NoticeItem setContentUrl(final CharSequence value) {
      bitField0_ |= 0x00000010;
      contentUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string content_url = 3;</code>
     * @param value the contentUrl to set
     * @return this
     */
    public NoticeItem setContentUrl(final Utf8String value) {
      bitField0_ |= 0x00000010;
      contentUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @return whether the questId field is set
     */
    public boolean hasQuestId() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @return this
     */
    public NoticeItem clearQuestId() {
      bitField0_ &= ~0x00000020;
      questId.clear();
      return this;
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @return the questId
     */
    public String getQuestId() {
      return questId.getString();
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @return internal {@code Utf8String} representation of questId for reading
     */
    public Utf8String getQuestIdBytes() {
      return this.questId;
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @return internal {@code Utf8String} representation of questId for modifications
     */
    public Utf8String getMutableQuestIdBytes() {
      bitField0_ |= 0x00000020;
      return this.questId;
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @param value the questId to set
     * @return this
     */
    public NoticeItem setQuestId(final CharSequence value) {
      bitField0_ |= 0x00000020;
      questId.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string quest_id = 5;</code>
     * @param value the questId to set
     * @return this
     */
    public NoticeItem setQuestId(final Utf8String value) {
      bitField0_ |= 0x00000020;
      questId.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated uint32 channel = 4;</code>
     * @return whether the channel field is set
     */
    public boolean hasChannel() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>repeated uint32 channel = 4;</code>
     * @return this
     */
    public NoticeItem clearChannel() {
      bitField0_ &= ~0x00000040;
      channel.clear();
      return this;
    }

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

    /**
     * <code>repeated uint32 channel = 4;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedInt getMutableChannel() {
      bitField0_ |= 0x00000040;
      return channel;
    }

    /**
     * <code>repeated uint32 channel = 4;</code>
     * @param value the channel to add
     * @return this
     */
    public NoticeItem addChannel(final int value) {
      bitField0_ |= 0x00000040;
      channel.add(value);
      return this;
    }

    /**
     * <code>repeated uint32 channel = 4;</code>
     * @param values the channel to add
     * @return this
     */
    public NoticeItem addAllChannel(final int... values) {
      bitField0_ |= 0x00000040;
      channel.addAll(values);
      return this;
    }

    @Override
    public NoticeItem copyFrom(final NoticeItem other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        endTime = other.endTime;
        sort = other.sort;
        id = other.id;
        title.copyFrom(other.title);
        contentUrl.copyFrom(other.contentUrl);
        questId.copyFrom(other.questId);
        channel.copyFrom(other.channel);
      }
      return this;
    }

    @Override
    public NoticeItem mergeFrom(final NoticeItem other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasEndTime()) {
        setEndTime(other.endTime);
      }
      if (other.hasSort()) {
        setSort(other.sort);
      }
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasTitle()) {
        getMutableTitleBytes().copyFrom(other.title);
      }
      if (other.hasContentUrl()) {
        getMutableContentUrlBytes().copyFrom(other.contentUrl);
      }
      if (other.hasQuestId()) {
        getMutableQuestIdBytes().copyFrom(other.questId);
      }
      if (other.hasChannel()) {
        getMutableChannel().addAll(other.channel);
      }
      return this;
    }

    @Override
    public NoticeItem clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      endTime = 0L;
      sort = 0L;
      id = 0L;
      title.clear();
      contentUrl.clear();
      questId.clear();
      channel.clear();
      return this;
    }

    @Override
    public NoticeItem clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      title.clear();
      contentUrl.clear();
      questId.clear();
      channel.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof NoticeItem)) {
        return false;
      }
      NoticeItem other = (NoticeItem) o;
      return bitField0_ == other.bitField0_
        && (!hasEndTime() || endTime == other.endTime)
        && (!hasSort() || sort == other.sort)
        && (!hasId() || id == other.id)
        && (!hasTitle() || title.equals(other.title))
        && (!hasContentUrl() || contentUrl.equals(other.contentUrl))
        && (!hasQuestId() || questId.equals(other.questId))
        && (!hasChannel() || channel.equals(other.channel));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 48);
        output.writeInt64NoTag(endTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 56);
        output.writeInt64NoTag(sort);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt64NoTag(id);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 18);
        output.writeStringNoTag(title);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 26);
        output.writeStringNoTag(contentUrl);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 42);
        output.writeStringNoTag(questId);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        for (int i = 0; i < channel.length(); i++) {
          output.writeRawByte((byte) 32);
          output.writeUInt32NoTag(channel.array()[i]);
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(endTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeInt64SizeNoTag(sort);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt64SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(title);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(contentUrl);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(questId);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += (1 * channel.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(channel);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public NoticeItem mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 48: {
            // endTime
            endTime = input.readInt64();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 56) {
              break;
            }
          }
          case 56: {
            // sort
            sort = input.readInt64();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 8) {
              break;
            }
          }
          case 8: {
            // id
            id = input.readUInt64();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // title
            input.readString(title);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // contentUrl
            input.readString(contentUrl);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 42) {
              break;
            }
          }
          case 42: {
            // questId
            input.readString(questId);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 34) {
              break;
            }
          }
          case 34: {
            // channel [packed=true]
            input.readPackedUInt32(channel, tag);
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
          case 32: {
            // channel [packed=false]
            tag = input.readRepeatedUInt32(channel, tag);
            bitField0_ |= 0x00000040;
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeInt64(FieldNames.endTime, endTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeInt64(FieldNames.sort, sort);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt64(FieldNames.id, id);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeString(FieldNames.title, title);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeString(FieldNames.contentUrl, contentUrl);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeString(FieldNames.questId, questId);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRepeatedUInt32(FieldNames.channel, channel);
      }
      output.endObject();
    }

    @Override
    public NoticeItem mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -1607243192:
          case 1725551537: {
            if (input.isAtField(FieldNames.endTime)) {
              if (!input.trySkipNullValue()) {
                endTime = input.readInt64();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3536286: {
            if (input.isAtField(FieldNames.sort)) {
              if (!input.trySkipNullValue()) {
                sort = input.readInt64();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3355: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt64();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 110371416: {
            if (input.isAtField(FieldNames.title)) {
              if (!input.trySkipNullValue()) {
                input.readString(title);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 264542774:
          case -388807511: {
            if (input.isAtField(FieldNames.contentUrl)) {
              if (!input.trySkipNullValue()) {
                input.readString(contentUrl);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 655126941:
          case -1165879912: {
            if (input.isAtField(FieldNames.questId)) {
              if (!input.trySkipNullValue()) {
                input.readString(questId);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 738950403: {
            if (input.isAtField(FieldNames.channel)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedUInt32(channel);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum NoticeItemFactory implements MessageFactory<NoticeItem> {
      INSTANCE;

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

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

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

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

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

      static final FieldName contentUrl = FieldName.forField("contentUrl", "content_url");

      static final FieldName questId = FieldName.forField("questId", "quest_id");

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

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

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

    private NoticeList() {
    }

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

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

    /**
     * <code>repeated .pb.NoticeType list = 1;</code>
     * @return this
     */
    public NoticeList clearList() {
      bitField0_ &= ~0x00000001;
      list.clear();
      return this;
    }

    /**
     * <code>repeated .pb.NoticeType list = 1;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<NoticeType> getList() {
      return list;
    }

    /**
     * <code>repeated .pb.NoticeType list = 1;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedMessage<NoticeType> getMutableList() {
      bitField0_ |= 0x00000001;
      return list;
    }

    /**
     * <code>repeated .pb.NoticeType list = 1;</code>
     * @param value the list to add
     * @return this
     */
    public NoticeList addList(final NoticeType value) {
      bitField0_ |= 0x00000001;
      list.add(value);
      return this;
    }

    /**
     * <code>repeated .pb.NoticeType list = 1;</code>
     * @param values the list to add
     * @return this
     */
    public NoticeList addAllList(final NoticeType... values) {
      bitField0_ |= 0x00000001;
      list.addAll(values);
      return this;
    }

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

    @Override
    public NoticeList mergeFrom(final NoticeList other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasList()) {
        getMutableList().addAll(other.list);
      }
      return this;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof NoticeList)) {
        return false;
      }
      NoticeList other = (NoticeList) o;
      return bitField0_ == other.bitField0_
        && (!hasList() || list.equals(other.list));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        for (int i = 0; i < list.length(); i++) {
          output.writeRawByte((byte) 10);
          output.writeMessageNoTag(list.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += (1 * list.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(list);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public NoticeList mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 10: {
            // list
            tag = input.readRepeatedMessage(list, tag);
            bitField0_ |= 0x00000001;
            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.writeRepeatedMessage(FieldNames.list, list);
      }
      output.endObject();
    }

    @Override
    public NoticeList mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3322014: {
            if (input.isAtField(FieldNames.list)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(list);
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum NoticeListFactory implements MessageFactory<NoticeList> {
      INSTANCE;

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

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

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

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

    /**
     * <code>repeated .pb.NoticeItem detail = 2;</code>
     */
    private final RepeatedMessage<NoticeItem> detail = RepeatedMessage.newEmptyInstance(NoticeItem.getFactory());

    private NoticeType() {
    }

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

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

    /**
     * <code>optional string name = 1;</code>
     * @return this
     */
    public NoticeType clearName() {
      bitField0_ &= ~0x00000001;
      name.clear();
      return this;
    }

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

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

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

    /**
     * <code>optional string name = 1;</code>
     * @param value the name to set
     * @return this
     */
    public NoticeType setName(final CharSequence value) {
      bitField0_ |= 0x00000001;
      name.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string name = 1;</code>
     * @param value the name to set
     * @return this
     */
    public NoticeType setName(final Utf8String value) {
      bitField0_ |= 0x00000001;
      name.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated .pb.NoticeItem detail = 2;</code>
     * @return whether the detail field is set
     */
    public boolean hasDetail() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>repeated .pb.NoticeItem detail = 2;</code>
     * @return this
     */
    public NoticeType clearDetail() {
      bitField0_ &= ~0x00000002;
      detail.clear();
      return this;
    }

    /**
     * <code>repeated .pb.NoticeItem detail = 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 #getMutableDetail()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<NoticeItem> getDetail() {
      return detail;
    }

    /**
     * <code>repeated .pb.NoticeItem detail = 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 RepeatedMessage<NoticeItem> getMutableDetail() {
      bitField0_ |= 0x00000002;
      return detail;
    }

    /**
     * <code>repeated .pb.NoticeItem detail = 2;</code>
     * @param value the detail to add
     * @return this
     */
    public NoticeType addDetail(final NoticeItem value) {
      bitField0_ |= 0x00000002;
      detail.add(value);
      return this;
    }

    /**
     * <code>repeated .pb.NoticeItem detail = 2;</code>
     * @param values the detail to add
     * @return this
     */
    public NoticeType addAllDetail(final NoticeItem... values) {
      bitField0_ |= 0x00000002;
      detail.addAll(values);
      return this;
    }

    @Override
    public NoticeType copyFrom(final NoticeType other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        name.copyFrom(other.name);
        detail.copyFrom(other.detail);
      }
      return this;
    }

    @Override
    public NoticeType mergeFrom(final NoticeType other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasName()) {
        getMutableNameBytes().copyFrom(other.name);
      }
      if (other.hasDetail()) {
        getMutableDetail().addAll(other.detail);
      }
      return this;
    }

    @Override
    public NoticeType clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      name.clear();
      detail.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof NoticeType)) {
        return false;
      }
      NoticeType other = (NoticeType) o;
      return bitField0_ == other.bitField0_
        && (!hasName() || name.equals(other.name))
        && (!hasDetail() || detail.equals(other.detail));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 10);
        output.writeStringNoTag(name);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        for (int i = 0; i < detail.length(); i++) {
          output.writeRawByte((byte) 18);
          output.writeMessageNoTag(detail.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(name);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += (1 * detail.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(detail);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public NoticeType mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 10: {
            // name
            input.readString(name);
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // detail
            tag = input.readRepeatedMessage(detail, tag);
            bitField0_ |= 0x00000002;
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeString(FieldNames.name, name);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRepeatedMessage(FieldNames.detail, detail);
      }
      output.endObject();
    }

    @Override
    public NoticeType mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3373707: {
            if (input.isAtField(FieldNames.name)) {
              if (!input.trySkipNullValue()) {
                input.readString(name);
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1335224239: {
            if (input.isAtField(FieldNames.detail)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(detail);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum NoticeTypeFactory implements MessageFactory<NoticeType> {
      INSTANCE;

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

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

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