// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
// Code generated by protocol buffer compiler. Do not edit!
package org.wpilib.command3.proto;

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

public final class ProtobufCommands {
  private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(2542,
    "Chdwcm90b2J1Zl9jb21tYW5kcy5wcm90bxIJd3BpLnByb3RvIicKEVByb3RvYnVmTWVjaGFuaXNtEhIK" + 
    "BG5hbWUYASABKAlSBG5hbWUitgIKD1Byb3RvYnVmQ29tbWFuZBIOCgJpZBgBIAEoDVICaWQSIAoJcGFy" + 
    "ZW50X2lkGAIgASgNSABSCHBhcmVudElkiAEBEhIKBG5hbWUYAyABKAlSBG5hbWUSGgoIcHJpb3JpdHkY" + 
    "BCABKAVSCHByaW9yaXR5EkAKDHJlcXVpcmVtZW50cxgFIAMoCzIcLndwaS5wcm90by5Qcm90b2J1Zk1l" + 
    "Y2hhbmlzbVIMcmVxdWlyZW1lbnRzEiUKDGxhc3RfdGltZV9tcxgGIAEoAUgBUgpsYXN0VGltZU1ziAEB" + 
    "EicKDXRvdGFsX3RpbWVfbXMYByABKAFIAlILdG90YWxUaW1lTXOIAQFCDAoKX3BhcmVudF9pZEIPCg1f" + 
    "bGFzdF90aW1lX21zQhAKDl90b3RhbF90aW1lX21zIsEBChFQcm90b2J1ZlNjaGVkdWxlchJDCg9xdWV1" + 
    "ZWRfY29tbWFuZHMYASADKAsyGi53cGkucHJvdG8uUHJvdG9idWZDb21tYW5kUg5xdWV1ZWRDb21tYW5k" + 
    "cxJFChBydW5uaW5nX2NvbW1hbmRzGAIgAygLMhoud3BpLnByb3RvLlByb3RvYnVmQ29tbWFuZFIPcnVu" + 
    "bmluZ0NvbW1hbmRzEiAKDGxhc3RfdGltZV9tcxgDIAEoAVIKbGFzdFRpbWVNc0IbChlvcmcud3BpbGli" + 
    "LmNvbW1hbmQzLnByb3RvSvwOCgYSBAAAOAEKCAoBDBIDAAASCggKAQISAwIAEgoICgEIEgMEADIKCQoC" + 
    "CAESAwQAMgrxAQoCBAASBBAAEgEy5AEKT3IgdXNlIHRoZSBnZW5lcmF0ZV9maWxlcy5weSBzY3JpcHQ6" + 
    "CgojIG1hY09TCmFsbHdwaWxpYiAkIC4vY29tbWFuZHN2My9nZW5lcmF0ZV9maWxlcy5weSAtLXByb3Rv" + 
    "Yz1wcm90b2MtcXVpY2tidWYKCiMgTGludXgKYWxsd3BpbGliICQgLi9jb21tYW5kc3YzL2dlbmVyYXRl" + 
    "X2ZpbGVzLnB5IC0tcXVpY2tidWZfcGx1Z2luIHByb3RvYy1nZW4tcXVpY2tidWYtMS4zLjMtbGludXgt" + 
    "eDg2XzY0LmV4ZQoKCgoDBAABEgMQCBkKCwoEBAACABIDEQISCgwKBQQAAgAFEgMRAggKDAoFBAACAAES" + 
    "AxEJDQoMCgUEAAIAAxIDERARCgoKAgQBEgQUAC0BCgoKAwQBARIDFAgXCnEKBAQBAgASAxcCEBpkIEEg" + 
    "dW5pcXVlIElEIGZvciB0aGUgY29tbWFuZC4KIERpZmZlcmVudCBpbnZvY2F0aW9ucyBvZiB0aGUgc2Ft" + 
    "ZSBjb21tYW5kIG9iamVjdCBoYXZlIGRpZmZlcmVudCBJRHMuCgoMCgUEAQIABRIDFwIICgwKBQQBAgAB" + 
    "EgMXCQsKDAoFBAECAAMSAxcODwphCgQEAQIBEgMbAiAaVCBUaGUgSUQgb2YgdGhlIHBhcmVudCBjb21t",
    "YW5kLgogTm90IGluY2x1ZGVkIGluIHRoZSBtZXNzYWdlIGZvciB0b3AtbGV2ZWwgY29tbWFuZHMuCgoM" + 
    "CgUEAQIBBBIDGwIKCgwKBQQBAgEFEgMbCxEKDAoFBAECAQESAxsSGwoMCgUEAQIBAxIDGx4fCicKBAQB" + 
    "AgISAx4CEhoaIFRoZSBuYW1lIG9mIHRoZSBjb21tYW5kLgoKDAoFBAECAgUSAx4CCAoMCgUEAQICARID" + 
    "HgkNCgwKBQQBAgIDEgMeEBEKMQoEBAECAxIDIQIVGiQgVGhlIHByaW9yaXR5IGxldmVsIG9mIHRoZSBj" + 
    "b21tYW5kLgoKDAoFBAECAwUSAyECBwoMCgUEAQIDARIDIQgQCgwKBQQBAgMDEgMhExQKNgoEBAECBBID" + 
    "JAIuGikgVGhlIG1lY2hhbmlzbXMgcmVxdWlyZWQgYnkgdGhlIGNvbW1hbmQuCgoMCgUEAQIEBBIDJAIK" + 
    "CgwKBQQBAgQGEgMkCxwKDAoFBAECBAESAyQdKQoMCgUEAQIEAxIDJCwtCo4BCgQEAQIFEgMoAiMagAEg" + 
    "SG93IG11Y2ggdGltZSB0aGUgY29tbWFuZCB0b29rIHRvIGV4ZWN1dGUgaW4gaXRzIG1vc3QgcmVjZW50" + 
    "IHJ1bi4KIE9ubHkgaW5jbHVkZWQgaW4gYSBtZXNzYWdlIGZvciBhbiBhY3RpdmVseSBydW5uaW5nIGNv" + 
    "bW1hbmQuCgoMCgUEAQIFBBIDKAIKCgwKBQQBAgUFEgMoCxEKDAoFBAECBQESAygSHgoMCgUEAQIFAxID" + 
    "KCEiCoABCgQEAQIGEgMsAiQacyBIb3cgbG9uZyB0aGUgY29tbWFuZCBoYXMgdGFrZW4gdG8gcnVuLCBp" + 
    "biBhZ2dyZWdhdGUuCiBPbmx5IGluY2x1ZGVkIGluIGEgbWVzc2FnZSBmb3IgYW4gYWN0aXZlbHkgcnVu" + 
    "bmluZyBjb21tYW5kLgoKDAoFBAECBgQSAywCCgoMCgUEAQIGBRIDLAsRCgwKBQQBAgYBEgMsEh8KDAoF" + 
    "BAECBgMSAywiIwoKCgIEAhIELwA4AQoKCgMEAgESAy8IGQqNAgoEBAICABIDMwIvGv8BIE5vdGU6IGNv" + 
    "bW1hbmRzIGFyZSBnZW5lcmFsbHkgcXVldWVkIGJ5IHRyaWdnZXJzLCB3aGljaCBvY2N1cnMgaW1tZWRp" + 
    "YXRlbHkgYmVmb3JlIHRoZXkgYXJlCiBwcm9tb3RlZCBhbmQgc3RhcnQgcnVubmluZy4gRW50cmllcyB3" + 
    "aWxsIG9ubHkgYXBwZWFyIGhlcmUgd2hlbiBzZXJpYWxpemluZyBhIHNjaGVkdWxlcgogX2FmdGVyXyBt" + 
    "YW51YWxseSBzY2hlZHVsaW5nIGEgY29tbWFuZCBidXQgX2JlZm9yZV8gY2FsbGluZyBzY2hlZHVsZXIu" + 
    "cnVuKCkKCgwKBQQCAgAEEgMzAgoKDAoFBAICAAYSAzMLGgoMCgUEAgIAARIDMxsqCgwKBQQCAgADEgMz" + 
    "LS4KCwoEBAICARIDNAIwCgwKBQQCAgEEEgM0AgoKDAoFBAICAQYSAzQLGgoMCgUEAgIBARIDNBsrCgwK",
    "BQQCAgEDEgM0Li8KTwoEBAICAhIDNwIaGkIgSG93IG11Y2ggdGltZSB0aGUgc2NoZWR1bGVyIHRvb2sg" + 
    "aW4gaXRzIGxhc3QgYHJ1bigpYCBpbnZvY2F0aW9uLgoKDAoFBAICAgUSAzcCCAoMCgUEAgICARIDNwkV" + 
    "CgwKBQQCAgIDEgM3GBliBnByb3RvMw==");

  static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("protobuf_commands.proto", "wpi.proto", descriptorData);

  static final Descriptors.Descriptor wpi_proto_ProtobufMechanism_descriptor = descriptor.internalContainedType(38, 39, "ProtobufMechanism", "wpi.proto.ProtobufMechanism");

  static final Descriptors.Descriptor wpi_proto_ProtobufCommand_descriptor = descriptor.internalContainedType(80, 310, "ProtobufCommand", "wpi.proto.ProtobufCommand");

  static final Descriptors.Descriptor wpi_proto_ProtobufScheduler_descriptor = descriptor.internalContainedType(393, 193, "ProtobufScheduler", "wpi.proto.ProtobufScheduler");

  /**
   * @return this proto file's descriptor.
   */
  public static Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

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

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

    private ProtobufMechanism() {
    }

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

    /**
     * <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 ProtobufMechanism 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 ProtobufMechanism 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 ProtobufMechanism setName(final Utf8String value) {
      bitField0_ |= 0x00000001;
      name.copyFrom(value);
      return this;
    }

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

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

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

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

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

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

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

    @Override
    @SuppressWarnings("fallthrough")
    public ProtobufMechanism 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 != 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);
      }
      output.endObject();
    }

    @Override
    public ProtobufMechanism 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;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    /**
     * @return this type's descriptor.
     */
    public static Descriptors.Descriptor getDescriptor() {
      return ProtobufCommands.wpi_proto_ProtobufMechanism_descriptor;
    }

    private enum ProtobufMechanismFactory implements MessageFactory<ProtobufMechanism> {
      INSTANCE;

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

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

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

    /**
     * <pre>
     *  How much time the command took to execute in its most recent run.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double last_time_ms = 6;</code>
     */
    private double lastTimeMs;

    /**
     * <pre>
     *  How long the command has taken to run, in aggregate.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double total_time_ms = 7;</code>
     */
    private double totalTimeMs;

    /**
     * <pre>
     *  The priority level of the command.
     * </pre>
     *
     * <code>optional int32 priority = 4;</code>
     */
    private int priority;

    /**
     * <pre>
     *  A unique ID for the command.
     *  Different invocations of the same command object have different IDs.
     * </pre>
     *
     * <code>optional uint32 id = 1;</code>
     */
    private int id;

    /**
     * <pre>
     *  The ID of the parent command.
     *  Not included in the message for top-level commands.
     * </pre>
     *
     * <code>optional uint32 parent_id = 2;</code>
     */
    private int parentId;

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     */
    private final Utf8String name = Utf8String.newEmptyInstance();

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     */
    private final RepeatedMessage<ProtobufMechanism> requirements = RepeatedMessage.newEmptyInstance(ProtobufMechanism.getFactory());

    private ProtobufCommand() {
    }

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

    /**
     * <pre>
     *  How much time the command took to execute in its most recent run.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double last_time_ms = 6;</code>
     * @return whether the lastTimeMs field is set
     */
    public boolean hasLastTimeMs() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <pre>
     *  How much time the command took to execute in its most recent run.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double last_time_ms = 6;</code>
     * @return this
     */
    public ProtobufCommand clearLastTimeMs() {
      bitField0_ &= ~0x00000002;
      lastTimeMs = 0D;
      return this;
    }

    /**
     * <pre>
     *  How much time the command took to execute in its most recent run.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double last_time_ms = 6;</code>
     * @return the lastTimeMs
     */
    public double getLastTimeMs() {
      return lastTimeMs;
    }

    /**
     * <pre>
     *  How much time the command took to execute in its most recent run.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double last_time_ms = 6;</code>
     * @param value the lastTimeMs to set
     * @return this
     */
    public ProtobufCommand setLastTimeMs(final double value) {
      bitField0_ |= 0x00000002;
      lastTimeMs = value;
      return this;
    }

    /**
     * <pre>
     *  How long the command has taken to run, in aggregate.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double total_time_ms = 7;</code>
     * @return whether the totalTimeMs field is set
     */
    public boolean hasTotalTimeMs() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <pre>
     *  How long the command has taken to run, in aggregate.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double total_time_ms = 7;</code>
     * @return this
     */
    public ProtobufCommand clearTotalTimeMs() {
      bitField0_ &= ~0x00000001;
      totalTimeMs = 0D;
      return this;
    }

    /**
     * <pre>
     *  How long the command has taken to run, in aggregate.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double total_time_ms = 7;</code>
     * @return the totalTimeMs
     */
    public double getTotalTimeMs() {
      return totalTimeMs;
    }

    /**
     * <pre>
     *  How long the command has taken to run, in aggregate.
     *  Only included in a message for an actively running command.
     * </pre>
     *
     * <code>optional double total_time_ms = 7;</code>
     * @param value the totalTimeMs to set
     * @return this
     */
    public ProtobufCommand setTotalTimeMs(final double value) {
      bitField0_ |= 0x00000001;
      totalTimeMs = value;
      return this;
    }

    /**
     * <pre>
     *  The priority level of the command.
     * </pre>
     *
     * <code>optional int32 priority = 4;</code>
     * @return whether the priority field is set
     */
    public boolean hasPriority() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <pre>
     *  The priority level of the command.
     * </pre>
     *
     * <code>optional int32 priority = 4;</code>
     * @return this
     */
    public ProtobufCommand clearPriority() {
      bitField0_ &= ~0x00000008;
      priority = 0;
      return this;
    }

    /**
     * <pre>
     *  The priority level of the command.
     * </pre>
     *
     * <code>optional int32 priority = 4;</code>
     * @return the priority
     */
    public int getPriority() {
      return priority;
    }

    /**
     * <pre>
     *  The priority level of the command.
     * </pre>
     *
     * <code>optional int32 priority = 4;</code>
     * @param value the priority to set
     * @return this
     */
    public ProtobufCommand setPriority(final int value) {
      bitField0_ |= 0x00000008;
      priority = value;
      return this;
    }

    /**
     * <pre>
     *  A unique ID for the command.
     *  Different invocations of the same command object have different IDs.
     * </pre>
     *
     * <code>optional uint32 id = 1;</code>
     * @return whether the id field is set
     */
    public boolean hasId() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <pre>
     *  A unique ID for the command.
     *  Different invocations of the same command object have different IDs.
     * </pre>
     *
     * <code>optional uint32 id = 1;</code>
     * @return this
     */
    public ProtobufCommand clearId() {
      bitField0_ &= ~0x00000010;
      id = 0;
      return this;
    }

    /**
     * <pre>
     *  A unique ID for the command.
     *  Different invocations of the same command object have different IDs.
     * </pre>
     *
     * <code>optional uint32 id = 1;</code>
     * @return the id
     */
    public int getId() {
      return id;
    }

    /**
     * <pre>
     *  A unique ID for the command.
     *  Different invocations of the same command object have different IDs.
     * </pre>
     *
     * <code>optional uint32 id = 1;</code>
     * @param value the id to set
     * @return this
     */
    public ProtobufCommand setId(final int value) {
      bitField0_ |= 0x00000010;
      id = value;
      return this;
    }

    /**
     * <pre>
     *  The ID of the parent command.
     *  Not included in the message for top-level commands.
     * </pre>
     *
     * <code>optional uint32 parent_id = 2;</code>
     * @return whether the parentId field is set
     */
    public boolean hasParentId() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <pre>
     *  The ID of the parent command.
     *  Not included in the message for top-level commands.
     * </pre>
     *
     * <code>optional uint32 parent_id = 2;</code>
     * @return this
     */
    public ProtobufCommand clearParentId() {
      bitField0_ &= ~0x00000004;
      parentId = 0;
      return this;
    }

    /**
     * <pre>
     *  The ID of the parent command.
     *  Not included in the message for top-level commands.
     * </pre>
     *
     * <code>optional uint32 parent_id = 2;</code>
     * @return the parentId
     */
    public int getParentId() {
      return parentId;
    }

    /**
     * <pre>
     *  The ID of the parent command.
     *  Not included in the message for top-level commands.
     * </pre>
     *
     * <code>optional uint32 parent_id = 2;</code>
     * @param value the parentId to set
     * @return this
     */
    public ProtobufCommand setParentId(final int value) {
      bitField0_ |= 0x00000004;
      parentId = value;
      return this;
    }

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     * @return whether the name field is set
     */
    public boolean hasName() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     * @return this
     */
    public ProtobufCommand clearName() {
      bitField0_ &= ~0x00000020;
      name.clear();
      return this;
    }

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     * @return the name
     */
    public String getName() {
      return name.getString();
    }

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

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     * @return internal {@code Utf8String} representation of name for modifications
     */
    public Utf8String getMutableNameBytes() {
      bitField0_ |= 0x00000020;
      return this.name;
    }

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     * @param value the name to set
     * @return this
     */
    public ProtobufCommand setName(final CharSequence value) {
      bitField0_ |= 0x00000020;
      name.copyFrom(value);
      return this;
    }

    /**
     * <pre>
     *  The name of the command.
     * </pre>
     *
     * <code>optional string name = 3;</code>
     * @param value the name to set
     * @return this
     */
    public ProtobufCommand setName(final Utf8String value) {
      bitField0_ |= 0x00000020;
      name.copyFrom(value);
      return this;
    }

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     * @return whether the requirements field is set
     */
    public boolean hasRequirements() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     * @return this
     */
    public ProtobufCommand clearRequirements() {
      bitField0_ &= ~0x00000040;
      requirements.clear();
      return this;
    }

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableRequirements()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<ProtobufMechanism> getRequirements() {
      return requirements;
    }

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedMessage<ProtobufMechanism> getMutableRequirements() {
      bitField0_ |= 0x00000040;
      return requirements;
    }

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     * @param value the requirements to add
     * @return this
     */
    public ProtobufCommand addRequirements(final ProtobufMechanism value) {
      bitField0_ |= 0x00000040;
      requirements.add(value);
      return this;
    }

    /**
     * <pre>
     *  The mechanisms required by the command.
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufMechanism requirements = 5;</code>
     * @param values the requirements to add
     * @return this
     */
    public ProtobufCommand addAllRequirements(final ProtobufMechanism... values) {
      bitField0_ |= 0x00000040;
      requirements.addAll(values);
      return this;
    }

    @Override
    public ProtobufCommand copyFrom(final ProtobufCommand other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        lastTimeMs = other.lastTimeMs;
        totalTimeMs = other.totalTimeMs;
        priority = other.priority;
        id = other.id;
        parentId = other.parentId;
        name.copyFrom(other.name);
        requirements.copyFrom(other.requirements);
      }
      return this;
    }

    @Override
    public ProtobufCommand mergeFrom(final ProtobufCommand other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasLastTimeMs()) {
        setLastTimeMs(other.lastTimeMs);
      }
      if (other.hasTotalTimeMs()) {
        setTotalTimeMs(other.totalTimeMs);
      }
      if (other.hasPriority()) {
        setPriority(other.priority);
      }
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasParentId()) {
        setParentId(other.parentId);
      }
      if (other.hasName()) {
        getMutableNameBytes().copyFrom(other.name);
      }
      if (other.hasRequirements()) {
        getMutableRequirements().addAll(other.requirements);
      }
      return this;
    }

    @Override
    public ProtobufCommand clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      lastTimeMs = 0D;
      totalTimeMs = 0D;
      priority = 0;
      id = 0;
      parentId = 0;
      name.clear();
      requirements.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ProtobufCommand)) {
        return false;
      }
      ProtobufCommand other = (ProtobufCommand) o;
      return bitField0_ == other.bitField0_
        && (!hasLastTimeMs() || ProtoUtil.isEqual(lastTimeMs, other.lastTimeMs))
        && (!hasTotalTimeMs() || ProtoUtil.isEqual(totalTimeMs, other.totalTimeMs))
        && (!hasPriority() || priority == other.priority)
        && (!hasId() || id == other.id)
        && (!hasParentId() || parentId == other.parentId)
        && (!hasName() || name.equals(other.name))
        && (!hasRequirements() || requirements.equals(other.requirements));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 49);
        output.writeDoubleNoTag(lastTimeMs);
      }
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 57);
        output.writeDoubleNoTag(totalTimeMs);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 32);
        output.writeInt32NoTag(priority);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(id);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(parentId);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 26);
        output.writeStringNoTag(name);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        for (int i = 0; i < requirements.length(); i++) {
          output.writeRawByte((byte) 42);
          output.writeMessageNoTag(requirements.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000002) != 0) {
        size += 9;
      }
      if ((bitField0_ & 0x00000001) != 0) {
        size += 9;
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeInt32SizeNoTag(priority);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(parentId);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(name);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += (1 * requirements.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(requirements);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public ProtobufCommand mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 49: {
            // lastTimeMs
            lastTimeMs = input.readDouble();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 57) {
              break;
            }
          }
          case 57: {
            // totalTimeMs
            totalTimeMs = input.readDouble();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // priority
            priority = input.readInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 8) {
              break;
            }
          }
          case 8: {
            // id
            id = input.readUInt32();
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 16) {
              break;
            }
          }
          case 16: {
            // parentId
            parentId = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // name
            input.readString(name);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 42) {
              break;
            }
          }
          case 42: {
            // requirements
            tag = input.readRepeatedMessage(requirements, tag);
            bitField0_ |= 0x00000040;
            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_ & 0x00000002) != 0) {
        output.writeDouble(FieldNames.lastTimeMs, lastTimeMs);
      }
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeDouble(FieldNames.totalTimeMs, totalTimeMs);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeInt32(FieldNames.priority, priority);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeUInt32(FieldNames.id, id);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.parentId, parentId);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeString(FieldNames.name, name);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRepeatedMessage(FieldNames.requirements, requirements);
      }
      output.endObject();
    }

    @Override
    public ProtobufCommand mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 1958056841:
          case -740797521: {
            if (input.isAtField(FieldNames.lastTimeMs)) {
              if (!input.trySkipNullValue()) {
                lastTimeMs = input.readDouble();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -717217353:
          case 1006112349: {
            if (input.isAtField(FieldNames.totalTimeMs)) {
              if (!input.trySkipNullValue()) {
                totalTimeMs = input.readDouble();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1165461084: {
            if (input.isAtField(FieldNames.priority)) {
              if (!input.trySkipNullValue()) {
                priority = input.readInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3355: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt32();
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1175162725:
          case 2070327504: {
            if (input.isAtField(FieldNames.parentId)) {
              if (!input.trySkipNullValue()) {
                parentId = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3373707: {
            if (input.isAtField(FieldNames.name)) {
              if (!input.trySkipNullValue()) {
                input.readString(name);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1619874672: {
            if (input.isAtField(FieldNames.requirements)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(requirements);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    /**
     * @return this type's descriptor.
     */
    public static Descriptors.Descriptor getDescriptor() {
      return ProtobufCommands.wpi_proto_ProtobufCommand_descriptor;
    }

    private enum ProtobufCommandFactory implements MessageFactory<ProtobufCommand> {
      INSTANCE;

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

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

      static final FieldName totalTimeMs = FieldName.forField("totalTimeMs", "total_time_ms");

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

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

      static final FieldName parentId = FieldName.forField("parentId", "parent_id");

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

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

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

    /**
     * <pre>
     *  How much time the scheduler took in its last `run()` invocation.
     * </pre>
     *
     * <code>optional double last_time_ms = 3;</code>
     */
    private double lastTimeMs;

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 1;</code>
     */
    private final RepeatedMessage<ProtobufCommand> queuedCommands = RepeatedMessage.newEmptyInstance(ProtobufCommand.getFactory());

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 2;</code>
     */
    private final RepeatedMessage<ProtobufCommand> runningCommands = RepeatedMessage.newEmptyInstance(ProtobufCommand.getFactory());

    private ProtobufScheduler() {
    }

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

    /**
     * <pre>
     *  How much time the scheduler took in its last `run()` invocation.
     * </pre>
     *
     * <code>optional double last_time_ms = 3;</code>
     * @return whether the lastTimeMs field is set
     */
    public boolean hasLastTimeMs() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <pre>
     *  How much time the scheduler took in its last `run()` invocation.
     * </pre>
     *
     * <code>optional double last_time_ms = 3;</code>
     * @return this
     */
    public ProtobufScheduler clearLastTimeMs() {
      bitField0_ &= ~0x00000001;
      lastTimeMs = 0D;
      return this;
    }

    /**
     * <pre>
     *  How much time the scheduler took in its last `run()` invocation.
     * </pre>
     *
     * <code>optional double last_time_ms = 3;</code>
     * @return the lastTimeMs
     */
    public double getLastTimeMs() {
      return lastTimeMs;
    }

    /**
     * <pre>
     *  How much time the scheduler took in its last `run()` invocation.
     * </pre>
     *
     * <code>optional double last_time_ms = 3;</code>
     * @param value the lastTimeMs to set
     * @return this
     */
    public ProtobufScheduler setLastTimeMs(final double value) {
      bitField0_ |= 0x00000001;
      lastTimeMs = value;
      return this;
    }

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 1;</code>
     * @return whether the queuedCommands field is set
     */
    public boolean hasQueuedCommands() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 1;</code>
     * @return this
     */
    public ProtobufScheduler clearQueuedCommands() {
      bitField0_ &= ~0x00000002;
      queuedCommands.clear();
      return this;
    }

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 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 #getMutableQueuedCommands()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<ProtobufCommand> getQueuedCommands() {
      return queuedCommands;
    }

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 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<ProtobufCommand> getMutableQueuedCommands() {
      bitField0_ |= 0x00000002;
      return queuedCommands;
    }

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 1;</code>
     * @param value the queuedCommands to add
     * @return this
     */
    public ProtobufScheduler addQueuedCommands(final ProtobufCommand value) {
      bitField0_ |= 0x00000002;
      queuedCommands.add(value);
      return this;
    }

    /**
     * <pre>
     *  Note: commands are generally queued by triggers, which occurs immediately before they are
     *  promoted and start running. Entries will only appear here when serializing a scheduler
     *  _after_ manually scheduling a command but _before_ calling scheduler.run()
     * </pre>
     *
     * <code>repeated .wpi.proto.ProtobufCommand queued_commands = 1;</code>
     * @param values the queuedCommands to add
     * @return this
     */
    public ProtobufScheduler addAllQueuedCommands(final ProtobufCommand... values) {
      bitField0_ |= 0x00000002;
      queuedCommands.addAll(values);
      return this;
    }

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 2;</code>
     * @return whether the runningCommands field is set
     */
    public boolean hasRunningCommands() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 2;</code>
     * @return this
     */
    public ProtobufScheduler clearRunningCommands() {
      bitField0_ &= ~0x00000004;
      runningCommands.clear();
      return this;
    }

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 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 #getMutableRunningCommands()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<ProtobufCommand> getRunningCommands() {
      return runningCommands;
    }

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 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<ProtobufCommand> getMutableRunningCommands() {
      bitField0_ |= 0x00000004;
      return runningCommands;
    }

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 2;</code>
     * @param value the runningCommands to add
     * @return this
     */
    public ProtobufScheduler addRunningCommands(final ProtobufCommand value) {
      bitField0_ |= 0x00000004;
      runningCommands.add(value);
      return this;
    }

    /**
     * <code>repeated .wpi.proto.ProtobufCommand running_commands = 2;</code>
     * @param values the runningCommands to add
     * @return this
     */
    public ProtobufScheduler addAllRunningCommands(final ProtobufCommand... values) {
      bitField0_ |= 0x00000004;
      runningCommands.addAll(values);
      return this;
    }

    @Override
    public ProtobufScheduler copyFrom(final ProtobufScheduler other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        lastTimeMs = other.lastTimeMs;
        queuedCommands.copyFrom(other.queuedCommands);
        runningCommands.copyFrom(other.runningCommands);
      }
      return this;
    }

    @Override
    public ProtobufScheduler mergeFrom(final ProtobufScheduler other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasLastTimeMs()) {
        setLastTimeMs(other.lastTimeMs);
      }
      if (other.hasQueuedCommands()) {
        getMutableQueuedCommands().addAll(other.queuedCommands);
      }
      if (other.hasRunningCommands()) {
        getMutableRunningCommands().addAll(other.runningCommands);
      }
      return this;
    }

    @Override
    public ProtobufScheduler clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      lastTimeMs = 0D;
      queuedCommands.clear();
      runningCommands.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof ProtobufScheduler)) {
        return false;
      }
      ProtobufScheduler other = (ProtobufScheduler) o;
      return bitField0_ == other.bitField0_
        && (!hasLastTimeMs() || ProtoUtil.isEqual(lastTimeMs, other.lastTimeMs))
        && (!hasQueuedCommands() || queuedCommands.equals(other.queuedCommands))
        && (!hasRunningCommands() || runningCommands.equals(other.runningCommands));
    }

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

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

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

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeDouble(FieldNames.lastTimeMs, lastTimeMs);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRepeatedMessage(FieldNames.queuedCommands, queuedCommands);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRepeatedMessage(FieldNames.runningCommands, runningCommands);
      }
      output.endObject();
    }

    @Override
    public ProtobufScheduler mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 1958056841:
          case -740797521: {
            if (input.isAtField(FieldNames.lastTimeMs)) {
              if (!input.trySkipNullValue()) {
                lastTimeMs = input.readDouble();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -167160549:
          case -1904270380: {
            if (input.isAtField(FieldNames.queuedCommands)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(queuedCommands);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1719052953:
          case 1526672648: {
            if (input.isAtField(FieldNames.runningCommands)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(runningCommands);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    /**
     * @return this type's descriptor.
     */
    public static Descriptors.Descriptor getDescriptor() {
      return ProtobufCommands.wpi_proto_ProtobufScheduler_descriptor;
    }

    private enum ProtobufSchedulerFactory implements MessageFactory<ProtobufScheduler> {
      INSTANCE;

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

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

      static final FieldName queuedCommands = FieldName.forField("queuedCommands", "queued_commands");

      static final FieldName runningCommands = FieldName.forField("runningCommands", "running_commands");
    }
  }
}
