001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004// Code generated by protocol buffer compiler. Do not edit!
005package edu.wpi.first.math.proto;
006
007import java.io.IOException;
008import us.hebi.quickbuf.Descriptors;
009import us.hebi.quickbuf.FieldName;
010import us.hebi.quickbuf.InvalidProtocolBufferException;
011import us.hebi.quickbuf.JsonSink;
012import us.hebi.quickbuf.JsonSource;
013import us.hebi.quickbuf.MessageFactory;
014import us.hebi.quickbuf.ProtoMessage;
015import us.hebi.quickbuf.ProtoSink;
016import us.hebi.quickbuf.ProtoSource;
017import us.hebi.quickbuf.ProtoUtil;
018import us.hebi.quickbuf.RepeatedByte;
019
020public final class Geometry2D {
021  private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1889,
022    "ChBnZW9tZXRyeTJkLnByb3RvEgl3cGkucHJvdG8iMwoVUHJvdG9idWZUcmFuc2xhdGlvbjJkEgwKAXgY" + 
023    "ASABKAFSAXgSDAoBeRgCIAEoAVIBeSIqChJQcm90b2J1ZlJvdGF0aW9uMmQSFAoFdmFsdWUYASABKAFS" + 
024    "BXZhbHVlIo8BCg5Qcm90b2J1ZlBvc2UyZBJCCgt0cmFuc2xhdGlvbhgBIAEoCzIgLndwaS5wcm90by5Q" + 
025    "cm90b2J1ZlRyYW5zbGF0aW9uMmRSC3RyYW5zbGF0aW9uEjkKCHJvdGF0aW9uGAIgASgLMh0ud3BpLnBy" + 
026    "b3RvLlByb3RvYnVmUm90YXRpb24yZFIIcm90YXRpb24ilAEKE1Byb3RvYnVmVHJhbnNmb3JtMmQSQgoL" + 
027    "dHJhbnNsYXRpb24YASABKAsyIC53cGkucHJvdG8uUHJvdG9idWZUcmFuc2xhdGlvbjJkUgt0cmFuc2xh" + 
028    "dGlvbhI5Cghyb3RhdGlvbhgCIAEoCzIdLndwaS5wcm90by5Qcm90b2J1ZlJvdGF0aW9uMmRSCHJvdGF0" + 
029    "aW9uIkkKD1Byb3RvYnVmVHdpc3QyZBIOCgJkeBgBIAEoAVICZHgSDgoCZHkYAiABKAFSAmR5EhYKBmR0" + 
030    "aGV0YRgDIAEoAVIGZHRoZXRhIngKE1Byb3RvYnVmUmVjdGFuZ2xlMmQSMQoGY2VudGVyGAEgASgLMhku" + 
031    "d3BpLnByb3RvLlByb3RvYnVmUG9zZTJkUgZjZW50ZXISFgoGeFdpZHRoGAIgASgBUgZ4V2lkdGgSFgoG" + 
032    "eVdpZHRoGAMgASgBUgZ5V2lkdGgiggEKEVByb3RvYnVmRWxsaXBzZTJkEjEKBmNlbnRlchgBIAEoCzIZ" + 
033    "LndwaS5wcm90by5Qcm90b2J1ZlBvc2UyZFIGY2VudGVyEhwKCXhTZW1pQXhpcxgCIAEoAVIJeFNlbWlB" + 
034    "eGlzEhwKCXlTZW1pQXhpcxgDIAEoAVIJeVNlbWlBeGlzQhoKGGVkdS53cGkuZmlyc3QubWF0aC5wcm90" + 
035    "b0rJCAoGEgQAACkBCggKAQwSAwAAEgoICgECEgMCABIKCAoBCBIDBAAxCgkKAggBEgMEADEKCgoCBAAS" + 
036    "BAYACQEKCgoDBAABEgMGCB0KCwoEBAACABIDBwIPCgwKBQQAAgAFEgMHAggKDAoFBAACAAESAwcJCgoM" + 
037    "CgUEAAIAAxIDBw0OCgsKBAQAAgESAwgCDwoMCgUEAAIBBRIDCAIICgwKBQQAAgEBEgMICQoKDAoFBAAC" + 
038    "AQMSAwgNDgoKCgIEARIECwANAQoKCgMEAQESAwsIGgoLCgQEAQIAEgMMAhMKDAoFBAECAAUSAwwCCAoM" + 
039    "CgUEAQIAARIDDAkOCgwKBQQBAgADEgMMERIKCgoCBAISBA8AEgEKCgoDBAIBEgMPCBYKCwoEBAICABID" + 
040    "EAIoCgwKBQQCAgAGEgMQAhcKDAoFBAICAAESAxAYIwoMCgUEAgIAAxIDECYnCgsKBAQCAgESAxECIgoM" + 
041    "CgUEAgIBBhIDEQIUCgwKBQQCAgEBEgMRFR0KDAoFBAICAQMSAxEgIQoKCgIEAxIEFAAXAQoKCgMEAwES",
042    "AxQIGwoLCgQEAwIAEgMVAigKDAoFBAMCAAYSAxUCFwoMCgUEAwIAARIDFRgjCgwKBQQDAgADEgMVJicK" + 
043    "CwoEBAMCARIDFgIiCgwKBQQDAgEGEgMWAhQKDAoFBAMCAQESAxYVHQoMCgUEAwIBAxIDFiAhCgoKAgQE" + 
044    "EgQZAB0BCgoKAwQEARIDGQgXCgsKBAQEAgASAxoCEAoMCgUEBAIABRIDGgIICgwKBQQEAgABEgMaCQsK" + 
045    "DAoFBAQCAAMSAxoODwoLCgQEBAIBEgMbAhAKDAoFBAQCAQUSAxsCCAoMCgUEBAIBARIDGwkLCgwKBQQE" + 
046    "AgEDEgMbDg8KCwoEBAQCAhIDHAIUCgwKBQQEAgIFEgMcAggKDAoFBAQCAgESAxwJDwoMCgUEBAICAxID" + 
047    "HBITCgoKAgQFEgQfACMBCgoKAwQFARIDHwgbCgsKBAQFAgASAyACHAoMCgUEBQIABhIDIAIQCgwKBQQF" + 
048    "AgABEgMgERcKDAoFBAUCAAMSAyAaGwoLCgQEBQIBEgMhAhQKDAoFBAUCAQUSAyECCAoMCgUEBQIBARID" + 
049    "IQkPCgwKBQQFAgEDEgMhEhMKCwoEBAUCAhIDIgIUCgwKBQQFAgIFEgMiAggKDAoFBAUCAgESAyIJDwoM" + 
050    "CgUEBQICAxIDIhITCgoKAgQGEgQlACkBCgoKAwQGARIDJQgZCgsKBAQGAgASAyYCHAoMCgUEBgIABhID" + 
051    "JgIQCgwKBQQGAgABEgMmERcKDAoFBAYCAAMSAyYaGwoLCgQEBgIBEgMnAhcKDAoFBAYCAQUSAycCCAoM" + 
052    "CgUEBgIBARIDJwkSCgwKBQQGAgEDEgMnFRYKCwoEBAYCAhIDKAIXCgwKBQQGAgIFEgMoAggKDAoFBAYC" + 
053    "AgESAygJEgoMCgUEBgICAxIDKBUWYgZwcm90bzM=");
054
055  static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("geometry2d.proto", "wpi.proto", descriptorData);
056
057  static final Descriptors.Descriptor wpi_proto_ProtobufTranslation2d_descriptor = descriptor.internalContainedType(31, 51, "ProtobufTranslation2d", "wpi.proto.ProtobufTranslation2d");
058
059  static final Descriptors.Descriptor wpi_proto_ProtobufRotation2d_descriptor = descriptor.internalContainedType(84, 42, "ProtobufRotation2d", "wpi.proto.ProtobufRotation2d");
060
061  static final Descriptors.Descriptor wpi_proto_ProtobufPose2d_descriptor = descriptor.internalContainedType(129, 143, "ProtobufPose2d", "wpi.proto.ProtobufPose2d");
062
063  static final Descriptors.Descriptor wpi_proto_ProtobufTransform2d_descriptor = descriptor.internalContainedType(275, 148, "ProtobufTransform2d", "wpi.proto.ProtobufTransform2d");
064
065  static final Descriptors.Descriptor wpi_proto_ProtobufTwist2d_descriptor = descriptor.internalContainedType(425, 73, "ProtobufTwist2d", "wpi.proto.ProtobufTwist2d");
066
067  static final Descriptors.Descriptor wpi_proto_ProtobufRectangle2d_descriptor = descriptor.internalContainedType(500, 120, "ProtobufRectangle2d", "wpi.proto.ProtobufRectangle2d");
068
069  static final Descriptors.Descriptor wpi_proto_ProtobufEllipse2d_descriptor = descriptor.internalContainedType(623, 130, "ProtobufEllipse2d", "wpi.proto.ProtobufEllipse2d");
070
071  /**
072   * @return this proto file's descriptor.
073   */
074  public static Descriptors.FileDescriptor getDescriptor() {
075    return descriptor;
076  }
077
078  /**
079   * Protobuf type {@code ProtobufTranslation2d}
080   */
081  public static final class ProtobufTranslation2d extends ProtoMessage<ProtobufTranslation2d> implements Cloneable {
082    private static final long serialVersionUID = 0L;
083
084    /**
085     * <code>optional double x = 1;</code>
086     */
087    private double x;
088
089    /**
090     * <code>optional double y = 2;</code>
091     */
092    private double y;
093
094    private ProtobufTranslation2d() {
095    }
096
097    /**
098     * @return a new empty instance of {@code ProtobufTranslation2d}
099     */
100    public static ProtobufTranslation2d newInstance() {
101      return new ProtobufTranslation2d();
102    }
103
104    /**
105     * <code>optional double x = 1;</code>
106     * @return whether the x field is set
107     */
108    public boolean hasX() {
109      return (bitField0_ & 0x00000001) != 0;
110    }
111
112    /**
113     * <code>optional double x = 1;</code>
114     * @return this
115     */
116    public ProtobufTranslation2d clearX() {
117      bitField0_ &= ~0x00000001;
118      x = 0D;
119      return this;
120    }
121
122    /**
123     * <code>optional double x = 1;</code>
124     * @return the x
125     */
126    public double getX() {
127      return x;
128    }
129
130    /**
131     * <code>optional double x = 1;</code>
132     * @param value the x to set
133     * @return this
134     */
135    public ProtobufTranslation2d setX(final double value) {
136      bitField0_ |= 0x00000001;
137      x = value;
138      return this;
139    }
140
141    /**
142     * <code>optional double y = 2;</code>
143     * @return whether the y field is set
144     */
145    public boolean hasY() {
146      return (bitField0_ & 0x00000002) != 0;
147    }
148
149    /**
150     * <code>optional double y = 2;</code>
151     * @return this
152     */
153    public ProtobufTranslation2d clearY() {
154      bitField0_ &= ~0x00000002;
155      y = 0D;
156      return this;
157    }
158
159    /**
160     * <code>optional double y = 2;</code>
161     * @return the y
162     */
163    public double getY() {
164      return y;
165    }
166
167    /**
168     * <code>optional double y = 2;</code>
169     * @param value the y to set
170     * @return this
171     */
172    public ProtobufTranslation2d setY(final double value) {
173      bitField0_ |= 0x00000002;
174      y = value;
175      return this;
176    }
177
178    @Override
179    public ProtobufTranslation2d copyFrom(final ProtobufTranslation2d other) {
180      cachedSize = other.cachedSize;
181      if ((bitField0_ | other.bitField0_) != 0) {
182        bitField0_ = other.bitField0_;
183        x = other.x;
184        y = other.y;
185      }
186      return this;
187    }
188
189    @Override
190    public ProtobufTranslation2d mergeFrom(final ProtobufTranslation2d other) {
191      if (other.isEmpty()) {
192        return this;
193      }
194      cachedSize = -1;
195      if (other.hasX()) {
196        setX(other.x);
197      }
198      if (other.hasY()) {
199        setY(other.y);
200      }
201      return this;
202    }
203
204    @Override
205    public ProtobufTranslation2d clear() {
206      if (isEmpty()) {
207        return this;
208      }
209      cachedSize = -1;
210      bitField0_ = 0;
211      x = 0D;
212      y = 0D;
213      return this;
214    }
215
216    @Override
217    public ProtobufTranslation2d clearQuick() {
218      if (isEmpty()) {
219        return this;
220      }
221      cachedSize = -1;
222      bitField0_ = 0;
223      return this;
224    }
225
226    @Override
227    public boolean equals(Object o) {
228      if (o == this) {
229        return true;
230      }
231      if (!(o instanceof ProtobufTranslation2d)) {
232        return false;
233      }
234      ProtobufTranslation2d other = (ProtobufTranslation2d) o;
235      return bitField0_ == other.bitField0_
236        && (!hasX() || ProtoUtil.isEqual(x, other.x))
237        && (!hasY() || ProtoUtil.isEqual(y, other.y));
238    }
239
240    @Override
241    public void writeTo(final ProtoSink output) throws IOException {
242      if ((bitField0_ & 0x00000001) != 0) {
243        output.writeRawByte((byte) 9);
244        output.writeDoubleNoTag(x);
245      }
246      if ((bitField0_ & 0x00000002) != 0) {
247        output.writeRawByte((byte) 17);
248        output.writeDoubleNoTag(y);
249      }
250    }
251
252    @Override
253    protected int computeSerializedSize() {
254      int size = 0;
255      if ((bitField0_ & 0x00000001) != 0) {
256        size += 9;
257      }
258      if ((bitField0_ & 0x00000002) != 0) {
259        size += 9;
260      }
261      return size;
262    }
263
264    @Override
265    @SuppressWarnings("fallthrough")
266    public ProtobufTranslation2d mergeFrom(final ProtoSource input) throws IOException {
267      // Enabled Fall-Through Optimization (QuickBuffers)
268      int tag = input.readTag();
269      while (true) {
270        switch (tag) {
271          case 9: {
272            // x
273            x = input.readDouble();
274            bitField0_ |= 0x00000001;
275            tag = input.readTag();
276            if (tag != 17) {
277              break;
278            }
279          }
280          case 17: {
281            // y
282            y = input.readDouble();
283            bitField0_ |= 0x00000002;
284            tag = input.readTag();
285            if (tag != 0) {
286              break;
287            }
288          }
289          case 0: {
290            return this;
291          }
292          default: {
293            if (!input.skipField(tag)) {
294              return this;
295            }
296            tag = input.readTag();
297            break;
298          }
299        }
300      }
301    }
302
303    @Override
304    public void writeTo(final JsonSink output) throws IOException {
305      output.beginObject();
306      if ((bitField0_ & 0x00000001) != 0) {
307        output.writeDouble(FieldNames.x, x);
308      }
309      if ((bitField0_ & 0x00000002) != 0) {
310        output.writeDouble(FieldNames.y, y);
311      }
312      output.endObject();
313    }
314
315    @Override
316    public ProtobufTranslation2d mergeFrom(final JsonSource input) throws IOException {
317      if (!input.beginObject()) {
318        return this;
319      }
320      while (!input.isAtEnd()) {
321        switch (input.readFieldHash()) {
322          case 120: {
323            if (input.isAtField(FieldNames.x)) {
324              if (!input.trySkipNullValue()) {
325                x = input.readDouble();
326                bitField0_ |= 0x00000001;
327              }
328            } else {
329              input.skipUnknownField();
330            }
331            break;
332          }
333          case 121: {
334            if (input.isAtField(FieldNames.y)) {
335              if (!input.trySkipNullValue()) {
336                y = input.readDouble();
337                bitField0_ |= 0x00000002;
338              }
339            } else {
340              input.skipUnknownField();
341            }
342            break;
343          }
344          default: {
345            input.skipUnknownField();
346            break;
347          }
348        }
349      }
350      input.endObject();
351      return this;
352    }
353
354    @Override
355    public ProtobufTranslation2d clone() {
356      return new ProtobufTranslation2d().copyFrom(this);
357    }
358
359    @Override
360    public boolean isEmpty() {
361      return ((bitField0_) == 0);
362    }
363
364    public static ProtobufTranslation2d parseFrom(final byte[] data) throws
365        InvalidProtocolBufferException {
366      return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), data).checkInitialized();
367    }
368
369    public static ProtobufTranslation2d parseFrom(final ProtoSource input) throws IOException {
370      return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), input).checkInitialized();
371    }
372
373    public static ProtobufTranslation2d parseFrom(final JsonSource input) throws IOException {
374      return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), input).checkInitialized();
375    }
376
377    /**
378     * @return factory for creating ProtobufTranslation2d messages
379     */
380    public static MessageFactory<ProtobufTranslation2d> getFactory() {
381      return ProtobufTranslation2dFactory.INSTANCE;
382    }
383
384    /**
385     * @return this type's descriptor.
386     */
387    public static Descriptors.Descriptor getDescriptor() {
388      return Geometry2D.wpi_proto_ProtobufTranslation2d_descriptor;
389    }
390
391    private enum ProtobufTranslation2dFactory implements MessageFactory<ProtobufTranslation2d> {
392      INSTANCE;
393
394      @Override
395      public ProtobufTranslation2d create() {
396        return ProtobufTranslation2d.newInstance();
397      }
398    }
399
400    /**
401     * Contains name constants used for serializing JSON
402     */
403    static class FieldNames {
404      static final FieldName x = FieldName.forField("x");
405
406      static final FieldName y = FieldName.forField("y");
407    }
408  }
409
410  /**
411   * Protobuf type {@code ProtobufRotation2d}
412   */
413  public static final class ProtobufRotation2d extends ProtoMessage<ProtobufRotation2d> implements Cloneable {
414    private static final long serialVersionUID = 0L;
415
416    /**
417     * <code>optional double value = 1;</code>
418     */
419    private double value_;
420
421    private ProtobufRotation2d() {
422    }
423
424    /**
425     * @return a new empty instance of {@code ProtobufRotation2d}
426     */
427    public static ProtobufRotation2d newInstance() {
428      return new ProtobufRotation2d();
429    }
430
431    /**
432     * <code>optional double value = 1;</code>
433     * @return whether the value_ field is set
434     */
435    public boolean hasValue() {
436      return (bitField0_ & 0x00000001) != 0;
437    }
438
439    /**
440     * <code>optional double value = 1;</code>
441     * @return this
442     */
443    public ProtobufRotation2d clearValue() {
444      bitField0_ &= ~0x00000001;
445      value_ = 0D;
446      return this;
447    }
448
449    /**
450     * <code>optional double value = 1;</code>
451     * @return the value_
452     */
453    public double getValue() {
454      return value_;
455    }
456
457    /**
458     * <code>optional double value = 1;</code>
459     * @param value the value_ to set
460     * @return this
461     */
462    public ProtobufRotation2d setValue(final double value) {
463      bitField0_ |= 0x00000001;
464      value_ = value;
465      return this;
466    }
467
468    @Override
469    public ProtobufRotation2d copyFrom(final ProtobufRotation2d other) {
470      cachedSize = other.cachedSize;
471      if ((bitField0_ | other.bitField0_) != 0) {
472        bitField0_ = other.bitField0_;
473        value_ = other.value_;
474      }
475      return this;
476    }
477
478    @Override
479    public ProtobufRotation2d mergeFrom(final ProtobufRotation2d other) {
480      if (other.isEmpty()) {
481        return this;
482      }
483      cachedSize = -1;
484      if (other.hasValue()) {
485        setValue(other.value_);
486      }
487      return this;
488    }
489
490    @Override
491    public ProtobufRotation2d clear() {
492      if (isEmpty()) {
493        return this;
494      }
495      cachedSize = -1;
496      bitField0_ = 0;
497      value_ = 0D;
498      return this;
499    }
500
501    @Override
502    public ProtobufRotation2d clearQuick() {
503      if (isEmpty()) {
504        return this;
505      }
506      cachedSize = -1;
507      bitField0_ = 0;
508      return this;
509    }
510
511    @Override
512    public boolean equals(Object o) {
513      if (o == this) {
514        return true;
515      }
516      if (!(o instanceof ProtobufRotation2d)) {
517        return false;
518      }
519      ProtobufRotation2d other = (ProtobufRotation2d) o;
520      return bitField0_ == other.bitField0_
521        && (!hasValue() || ProtoUtil.isEqual(value_, other.value_));
522    }
523
524    @Override
525    public void writeTo(final ProtoSink output) throws IOException {
526      if ((bitField0_ & 0x00000001) != 0) {
527        output.writeRawByte((byte) 9);
528        output.writeDoubleNoTag(value_);
529      }
530    }
531
532    @Override
533    protected int computeSerializedSize() {
534      int size = 0;
535      if ((bitField0_ & 0x00000001) != 0) {
536        size += 9;
537      }
538      return size;
539    }
540
541    @Override
542    @SuppressWarnings("fallthrough")
543    public ProtobufRotation2d mergeFrom(final ProtoSource input) throws IOException {
544      // Enabled Fall-Through Optimization (QuickBuffers)
545      int tag = input.readTag();
546      while (true) {
547        switch (tag) {
548          case 9: {
549            // value_
550            value_ = input.readDouble();
551            bitField0_ |= 0x00000001;
552            tag = input.readTag();
553            if (tag != 0) {
554              break;
555            }
556          }
557          case 0: {
558            return this;
559          }
560          default: {
561            if (!input.skipField(tag)) {
562              return this;
563            }
564            tag = input.readTag();
565            break;
566          }
567        }
568      }
569    }
570
571    @Override
572    public void writeTo(final JsonSink output) throws IOException {
573      output.beginObject();
574      if ((bitField0_ & 0x00000001) != 0) {
575        output.writeDouble(FieldNames.value_, value_);
576      }
577      output.endObject();
578    }
579
580    @Override
581    public ProtobufRotation2d mergeFrom(final JsonSource input) throws IOException {
582      if (!input.beginObject()) {
583        return this;
584      }
585      while (!input.isAtEnd()) {
586        switch (input.readFieldHash()) {
587          case 111972721: {
588            if (input.isAtField(FieldNames.value_)) {
589              if (!input.trySkipNullValue()) {
590                value_ = input.readDouble();
591                bitField0_ |= 0x00000001;
592              }
593            } else {
594              input.skipUnknownField();
595            }
596            break;
597          }
598          default: {
599            input.skipUnknownField();
600            break;
601          }
602        }
603      }
604      input.endObject();
605      return this;
606    }
607
608    @Override
609    public ProtobufRotation2d clone() {
610      return new ProtobufRotation2d().copyFrom(this);
611    }
612
613    @Override
614    public boolean isEmpty() {
615      return ((bitField0_) == 0);
616    }
617
618    public static ProtobufRotation2d parseFrom(final byte[] data) throws
619        InvalidProtocolBufferException {
620      return ProtoMessage.mergeFrom(new ProtobufRotation2d(), data).checkInitialized();
621    }
622
623    public static ProtobufRotation2d parseFrom(final ProtoSource input) throws IOException {
624      return ProtoMessage.mergeFrom(new ProtobufRotation2d(), input).checkInitialized();
625    }
626
627    public static ProtobufRotation2d parseFrom(final JsonSource input) throws IOException {
628      return ProtoMessage.mergeFrom(new ProtobufRotation2d(), input).checkInitialized();
629    }
630
631    /**
632     * @return factory for creating ProtobufRotation2d messages
633     */
634    public static MessageFactory<ProtobufRotation2d> getFactory() {
635      return ProtobufRotation2dFactory.INSTANCE;
636    }
637
638    /**
639     * @return this type's descriptor.
640     */
641    public static Descriptors.Descriptor getDescriptor() {
642      return Geometry2D.wpi_proto_ProtobufRotation2d_descriptor;
643    }
644
645    private enum ProtobufRotation2dFactory implements MessageFactory<ProtobufRotation2d> {
646      INSTANCE;
647
648      @Override
649      public ProtobufRotation2d create() {
650        return ProtobufRotation2d.newInstance();
651      }
652    }
653
654    /**
655     * Contains name constants used for serializing JSON
656     */
657    static class FieldNames {
658      static final FieldName value_ = FieldName.forField("value");
659    }
660  }
661
662  /**
663   * Protobuf type {@code ProtobufPose2d}
664   */
665  public static final class ProtobufPose2d extends ProtoMessage<ProtobufPose2d> implements Cloneable {
666    private static final long serialVersionUID = 0L;
667
668    /**
669     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
670     */
671    private final ProtobufTranslation2d translation = ProtobufTranslation2d.newInstance();
672
673    /**
674     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
675     */
676    private final ProtobufRotation2d rotation = ProtobufRotation2d.newInstance();
677
678    private ProtobufPose2d() {
679    }
680
681    /**
682     * @return a new empty instance of {@code ProtobufPose2d}
683     */
684    public static ProtobufPose2d newInstance() {
685      return new ProtobufPose2d();
686    }
687
688    /**
689     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
690     * @return whether the translation field is set
691     */
692    public boolean hasTranslation() {
693      return (bitField0_ & 0x00000001) != 0;
694    }
695
696    /**
697     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
698     * @return this
699     */
700    public ProtobufPose2d clearTranslation() {
701      bitField0_ &= ~0x00000001;
702      translation.clear();
703      return this;
704    }
705
706    /**
707     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
708     *
709     * This method returns the internal storage object without modifying any has state.
710     * The returned object should not be modified and be treated as read-only.
711     *
712     * Use {@link #getMutableTranslation()} if you want to modify it.
713     *
714     * @return internal storage object for reading
715     */
716    public ProtobufTranslation2d getTranslation() {
717      return translation;
718    }
719
720    /**
721     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
722     *
723     * This method returns the internal storage object and sets the corresponding
724     * has state. The returned object will become part of this message and its
725     * contents may be modified as long as the has state is not cleared.
726     *
727     * @return internal storage object for modifications
728     */
729    public ProtobufTranslation2d getMutableTranslation() {
730      bitField0_ |= 0x00000001;
731      return translation;
732    }
733
734    /**
735     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
736     * @param value the translation to set
737     * @return this
738     */
739    public ProtobufPose2d setTranslation(final ProtobufTranslation2d value) {
740      bitField0_ |= 0x00000001;
741      translation.copyFrom(value);
742      return this;
743    }
744
745    /**
746     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
747     * @return whether the rotation field is set
748     */
749    public boolean hasRotation() {
750      return (bitField0_ & 0x00000002) != 0;
751    }
752
753    /**
754     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
755     * @return this
756     */
757    public ProtobufPose2d clearRotation() {
758      bitField0_ &= ~0x00000002;
759      rotation.clear();
760      return this;
761    }
762
763    /**
764     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
765     *
766     * This method returns the internal storage object without modifying any has state.
767     * The returned object should not be modified and be treated as read-only.
768     *
769     * Use {@link #getMutableRotation()} if you want to modify it.
770     *
771     * @return internal storage object for reading
772     */
773    public ProtobufRotation2d getRotation() {
774      return rotation;
775    }
776
777    /**
778     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
779     *
780     * This method returns the internal storage object and sets the corresponding
781     * has state. The returned object will become part of this message and its
782     * contents may be modified as long as the has state is not cleared.
783     *
784     * @return internal storage object for modifications
785     */
786    public ProtobufRotation2d getMutableRotation() {
787      bitField0_ |= 0x00000002;
788      return rotation;
789    }
790
791    /**
792     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
793     * @param value the rotation to set
794     * @return this
795     */
796    public ProtobufPose2d setRotation(final ProtobufRotation2d value) {
797      bitField0_ |= 0x00000002;
798      rotation.copyFrom(value);
799      return this;
800    }
801
802    @Override
803    public ProtobufPose2d copyFrom(final ProtobufPose2d other) {
804      cachedSize = other.cachedSize;
805      if ((bitField0_ | other.bitField0_) != 0) {
806        bitField0_ = other.bitField0_;
807        translation.copyFrom(other.translation);
808        rotation.copyFrom(other.rotation);
809      }
810      return this;
811    }
812
813    @Override
814    public ProtobufPose2d mergeFrom(final ProtobufPose2d other) {
815      if (other.isEmpty()) {
816        return this;
817      }
818      cachedSize = -1;
819      if (other.hasTranslation()) {
820        getMutableTranslation().mergeFrom(other.translation);
821      }
822      if (other.hasRotation()) {
823        getMutableRotation().mergeFrom(other.rotation);
824      }
825      return this;
826    }
827
828    @Override
829    public ProtobufPose2d clear() {
830      if (isEmpty()) {
831        return this;
832      }
833      cachedSize = -1;
834      bitField0_ = 0;
835      translation.clear();
836      rotation.clear();
837      return this;
838    }
839
840    @Override
841    public ProtobufPose2d clearQuick() {
842      if (isEmpty()) {
843        return this;
844      }
845      cachedSize = -1;
846      bitField0_ = 0;
847      translation.clearQuick();
848      rotation.clearQuick();
849      return this;
850    }
851
852    @Override
853    public boolean equals(Object o) {
854      if (o == this) {
855        return true;
856      }
857      if (!(o instanceof ProtobufPose2d)) {
858        return false;
859      }
860      ProtobufPose2d other = (ProtobufPose2d) o;
861      return bitField0_ == other.bitField0_
862        && (!hasTranslation() || translation.equals(other.translation))
863        && (!hasRotation() || rotation.equals(other.rotation));
864    }
865
866    @Override
867    public void writeTo(final ProtoSink output) throws IOException {
868      if ((bitField0_ & 0x00000001) != 0) {
869        output.writeRawByte((byte) 10);
870        output.writeMessageNoTag(translation);
871      }
872      if ((bitField0_ & 0x00000002) != 0) {
873        output.writeRawByte((byte) 18);
874        output.writeMessageNoTag(rotation);
875      }
876    }
877
878    @Override
879    protected int computeSerializedSize() {
880      int size = 0;
881      if ((bitField0_ & 0x00000001) != 0) {
882        size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
883      }
884      if ((bitField0_ & 0x00000002) != 0) {
885        size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
886      }
887      return size;
888    }
889
890    @Override
891    @SuppressWarnings("fallthrough")
892    public ProtobufPose2d mergeFrom(final ProtoSource input) throws IOException {
893      // Enabled Fall-Through Optimization (QuickBuffers)
894      int tag = input.readTag();
895      while (true) {
896        switch (tag) {
897          case 10: {
898            // translation
899            input.readMessage(translation);
900            bitField0_ |= 0x00000001;
901            tag = input.readTag();
902            if (tag != 18) {
903              break;
904            }
905          }
906          case 18: {
907            // rotation
908            input.readMessage(rotation);
909            bitField0_ |= 0x00000002;
910            tag = input.readTag();
911            if (tag != 0) {
912              break;
913            }
914          }
915          case 0: {
916            return this;
917          }
918          default: {
919            if (!input.skipField(tag)) {
920              return this;
921            }
922            tag = input.readTag();
923            break;
924          }
925        }
926      }
927    }
928
929    @Override
930    public void writeTo(final JsonSink output) throws IOException {
931      output.beginObject();
932      if ((bitField0_ & 0x00000001) != 0) {
933        output.writeMessage(FieldNames.translation, translation);
934      }
935      if ((bitField0_ & 0x00000002) != 0) {
936        output.writeMessage(FieldNames.rotation, rotation);
937      }
938      output.endObject();
939    }
940
941    @Override
942    public ProtobufPose2d mergeFrom(final JsonSource input) throws IOException {
943      if (!input.beginObject()) {
944        return this;
945      }
946      while (!input.isAtEnd()) {
947        switch (input.readFieldHash()) {
948          case -1840647503: {
949            if (input.isAtField(FieldNames.translation)) {
950              if (!input.trySkipNullValue()) {
951                input.readMessage(translation);
952                bitField0_ |= 0x00000001;
953              }
954            } else {
955              input.skipUnknownField();
956            }
957            break;
958          }
959          case -40300674: {
960            if (input.isAtField(FieldNames.rotation)) {
961              if (!input.trySkipNullValue()) {
962                input.readMessage(rotation);
963                bitField0_ |= 0x00000002;
964              }
965            } else {
966              input.skipUnknownField();
967            }
968            break;
969          }
970          default: {
971            input.skipUnknownField();
972            break;
973          }
974        }
975      }
976      input.endObject();
977      return this;
978    }
979
980    @Override
981    public ProtobufPose2d clone() {
982      return new ProtobufPose2d().copyFrom(this);
983    }
984
985    @Override
986    public boolean isEmpty() {
987      return ((bitField0_) == 0);
988    }
989
990    public static ProtobufPose2d parseFrom(final byte[] data) throws
991        InvalidProtocolBufferException {
992      return ProtoMessage.mergeFrom(new ProtobufPose2d(), data).checkInitialized();
993    }
994
995    public static ProtobufPose2d parseFrom(final ProtoSource input) throws IOException {
996      return ProtoMessage.mergeFrom(new ProtobufPose2d(), input).checkInitialized();
997    }
998
999    public static ProtobufPose2d parseFrom(final JsonSource input) throws IOException {
1000      return ProtoMessage.mergeFrom(new ProtobufPose2d(), input).checkInitialized();
1001    }
1002
1003    /**
1004     * @return factory for creating ProtobufPose2d messages
1005     */
1006    public static MessageFactory<ProtobufPose2d> getFactory() {
1007      return ProtobufPose2dFactory.INSTANCE;
1008    }
1009
1010    /**
1011     * @return this type's descriptor.
1012     */
1013    public static Descriptors.Descriptor getDescriptor() {
1014      return Geometry2D.wpi_proto_ProtobufPose2d_descriptor;
1015    }
1016
1017    private enum ProtobufPose2dFactory implements MessageFactory<ProtobufPose2d> {
1018      INSTANCE;
1019
1020      @Override
1021      public ProtobufPose2d create() {
1022        return ProtobufPose2d.newInstance();
1023      }
1024    }
1025
1026    /**
1027     * Contains name constants used for serializing JSON
1028     */
1029    static class FieldNames {
1030      static final FieldName translation = FieldName.forField("translation");
1031
1032      static final FieldName rotation = FieldName.forField("rotation");
1033    }
1034  }
1035
1036  /**
1037   * Protobuf type {@code ProtobufTransform2d}
1038   */
1039  public static final class ProtobufTransform2d extends ProtoMessage<ProtobufTransform2d> implements Cloneable {
1040    private static final long serialVersionUID = 0L;
1041
1042    /**
1043     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
1044     */
1045    private final ProtobufTranslation2d translation = ProtobufTranslation2d.newInstance();
1046
1047    /**
1048     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
1049     */
1050    private final ProtobufRotation2d rotation = ProtobufRotation2d.newInstance();
1051
1052    private ProtobufTransform2d() {
1053    }
1054
1055    /**
1056     * @return a new empty instance of {@code ProtobufTransform2d}
1057     */
1058    public static ProtobufTransform2d newInstance() {
1059      return new ProtobufTransform2d();
1060    }
1061
1062    /**
1063     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
1064     * @return whether the translation field is set
1065     */
1066    public boolean hasTranslation() {
1067      return (bitField0_ & 0x00000001) != 0;
1068    }
1069
1070    /**
1071     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
1072     * @return this
1073     */
1074    public ProtobufTransform2d clearTranslation() {
1075      bitField0_ &= ~0x00000001;
1076      translation.clear();
1077      return this;
1078    }
1079
1080    /**
1081     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
1082     *
1083     * This method returns the internal storage object without modifying any has state.
1084     * The returned object should not be modified and be treated as read-only.
1085     *
1086     * Use {@link #getMutableTranslation()} if you want to modify it.
1087     *
1088     * @return internal storage object for reading
1089     */
1090    public ProtobufTranslation2d getTranslation() {
1091      return translation;
1092    }
1093
1094    /**
1095     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
1096     *
1097     * This method returns the internal storage object and sets the corresponding
1098     * has state. The returned object will become part of this message and its
1099     * contents may be modified as long as the has state is not cleared.
1100     *
1101     * @return internal storage object for modifications
1102     */
1103    public ProtobufTranslation2d getMutableTranslation() {
1104      bitField0_ |= 0x00000001;
1105      return translation;
1106    }
1107
1108    /**
1109     * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code>
1110     * @param value the translation to set
1111     * @return this
1112     */
1113    public ProtobufTransform2d setTranslation(final ProtobufTranslation2d value) {
1114      bitField0_ |= 0x00000001;
1115      translation.copyFrom(value);
1116      return this;
1117    }
1118
1119    /**
1120     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
1121     * @return whether the rotation field is set
1122     */
1123    public boolean hasRotation() {
1124      return (bitField0_ & 0x00000002) != 0;
1125    }
1126
1127    /**
1128     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
1129     * @return this
1130     */
1131    public ProtobufTransform2d clearRotation() {
1132      bitField0_ &= ~0x00000002;
1133      rotation.clear();
1134      return this;
1135    }
1136
1137    /**
1138     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
1139     *
1140     * This method returns the internal storage object without modifying any has state.
1141     * The returned object should not be modified and be treated as read-only.
1142     *
1143     * Use {@link #getMutableRotation()} if you want to modify it.
1144     *
1145     * @return internal storage object for reading
1146     */
1147    public ProtobufRotation2d getRotation() {
1148      return rotation;
1149    }
1150
1151    /**
1152     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
1153     *
1154     * This method returns the internal storage object and sets the corresponding
1155     * has state. The returned object will become part of this message and its
1156     * contents may be modified as long as the has state is not cleared.
1157     *
1158     * @return internal storage object for modifications
1159     */
1160    public ProtobufRotation2d getMutableRotation() {
1161      bitField0_ |= 0x00000002;
1162      return rotation;
1163    }
1164
1165    /**
1166     * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code>
1167     * @param value the rotation to set
1168     * @return this
1169     */
1170    public ProtobufTransform2d setRotation(final ProtobufRotation2d value) {
1171      bitField0_ |= 0x00000002;
1172      rotation.copyFrom(value);
1173      return this;
1174    }
1175
1176    @Override
1177    public ProtobufTransform2d copyFrom(final ProtobufTransform2d other) {
1178      cachedSize = other.cachedSize;
1179      if ((bitField0_ | other.bitField0_) != 0) {
1180        bitField0_ = other.bitField0_;
1181        translation.copyFrom(other.translation);
1182        rotation.copyFrom(other.rotation);
1183      }
1184      return this;
1185    }
1186
1187    @Override
1188    public ProtobufTransform2d mergeFrom(final ProtobufTransform2d other) {
1189      if (other.isEmpty()) {
1190        return this;
1191      }
1192      cachedSize = -1;
1193      if (other.hasTranslation()) {
1194        getMutableTranslation().mergeFrom(other.translation);
1195      }
1196      if (other.hasRotation()) {
1197        getMutableRotation().mergeFrom(other.rotation);
1198      }
1199      return this;
1200    }
1201
1202    @Override
1203    public ProtobufTransform2d clear() {
1204      if (isEmpty()) {
1205        return this;
1206      }
1207      cachedSize = -1;
1208      bitField0_ = 0;
1209      translation.clear();
1210      rotation.clear();
1211      return this;
1212    }
1213
1214    @Override
1215    public ProtobufTransform2d clearQuick() {
1216      if (isEmpty()) {
1217        return this;
1218      }
1219      cachedSize = -1;
1220      bitField0_ = 0;
1221      translation.clearQuick();
1222      rotation.clearQuick();
1223      return this;
1224    }
1225
1226    @Override
1227    public boolean equals(Object o) {
1228      if (o == this) {
1229        return true;
1230      }
1231      if (!(o instanceof ProtobufTransform2d)) {
1232        return false;
1233      }
1234      ProtobufTransform2d other = (ProtobufTransform2d) o;
1235      return bitField0_ == other.bitField0_
1236        && (!hasTranslation() || translation.equals(other.translation))
1237        && (!hasRotation() || rotation.equals(other.rotation));
1238    }
1239
1240    @Override
1241    public void writeTo(final ProtoSink output) throws IOException {
1242      if ((bitField0_ & 0x00000001) != 0) {
1243        output.writeRawByte((byte) 10);
1244        output.writeMessageNoTag(translation);
1245      }
1246      if ((bitField0_ & 0x00000002) != 0) {
1247        output.writeRawByte((byte) 18);
1248        output.writeMessageNoTag(rotation);
1249      }
1250    }
1251
1252    @Override
1253    protected int computeSerializedSize() {
1254      int size = 0;
1255      if ((bitField0_ & 0x00000001) != 0) {
1256        size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
1257      }
1258      if ((bitField0_ & 0x00000002) != 0) {
1259        size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
1260      }
1261      return size;
1262    }
1263
1264    @Override
1265    @SuppressWarnings("fallthrough")
1266    public ProtobufTransform2d mergeFrom(final ProtoSource input) throws IOException {
1267      // Enabled Fall-Through Optimization (QuickBuffers)
1268      int tag = input.readTag();
1269      while (true) {
1270        switch (tag) {
1271          case 10: {
1272            // translation
1273            input.readMessage(translation);
1274            bitField0_ |= 0x00000001;
1275            tag = input.readTag();
1276            if (tag != 18) {
1277              break;
1278            }
1279          }
1280          case 18: {
1281            // rotation
1282            input.readMessage(rotation);
1283            bitField0_ |= 0x00000002;
1284            tag = input.readTag();
1285            if (tag != 0) {
1286              break;
1287            }
1288          }
1289          case 0: {
1290            return this;
1291          }
1292          default: {
1293            if (!input.skipField(tag)) {
1294              return this;
1295            }
1296            tag = input.readTag();
1297            break;
1298          }
1299        }
1300      }
1301    }
1302
1303    @Override
1304    public void writeTo(final JsonSink output) throws IOException {
1305      output.beginObject();
1306      if ((bitField0_ & 0x00000001) != 0) {
1307        output.writeMessage(FieldNames.translation, translation);
1308      }
1309      if ((bitField0_ & 0x00000002) != 0) {
1310        output.writeMessage(FieldNames.rotation, rotation);
1311      }
1312      output.endObject();
1313    }
1314
1315    @Override
1316    public ProtobufTransform2d mergeFrom(final JsonSource input) throws IOException {
1317      if (!input.beginObject()) {
1318        return this;
1319      }
1320      while (!input.isAtEnd()) {
1321        switch (input.readFieldHash()) {
1322          case -1840647503: {
1323            if (input.isAtField(FieldNames.translation)) {
1324              if (!input.trySkipNullValue()) {
1325                input.readMessage(translation);
1326                bitField0_ |= 0x00000001;
1327              }
1328            } else {
1329              input.skipUnknownField();
1330            }
1331            break;
1332          }
1333          case -40300674: {
1334            if (input.isAtField(FieldNames.rotation)) {
1335              if (!input.trySkipNullValue()) {
1336                input.readMessage(rotation);
1337                bitField0_ |= 0x00000002;
1338              }
1339            } else {
1340              input.skipUnknownField();
1341            }
1342            break;
1343          }
1344          default: {
1345            input.skipUnknownField();
1346            break;
1347          }
1348        }
1349      }
1350      input.endObject();
1351      return this;
1352    }
1353
1354    @Override
1355    public ProtobufTransform2d clone() {
1356      return new ProtobufTransform2d().copyFrom(this);
1357    }
1358
1359    @Override
1360    public boolean isEmpty() {
1361      return ((bitField0_) == 0);
1362    }
1363
1364    public static ProtobufTransform2d parseFrom(final byte[] data) throws
1365        InvalidProtocolBufferException {
1366      return ProtoMessage.mergeFrom(new ProtobufTransform2d(), data).checkInitialized();
1367    }
1368
1369    public static ProtobufTransform2d parseFrom(final ProtoSource input) throws IOException {
1370      return ProtoMessage.mergeFrom(new ProtobufTransform2d(), input).checkInitialized();
1371    }
1372
1373    public static ProtobufTransform2d parseFrom(final JsonSource input) throws IOException {
1374      return ProtoMessage.mergeFrom(new ProtobufTransform2d(), input).checkInitialized();
1375    }
1376
1377    /**
1378     * @return factory for creating ProtobufTransform2d messages
1379     */
1380    public static MessageFactory<ProtobufTransform2d> getFactory() {
1381      return ProtobufTransform2dFactory.INSTANCE;
1382    }
1383
1384    /**
1385     * @return this type's descriptor.
1386     */
1387    public static Descriptors.Descriptor getDescriptor() {
1388      return Geometry2D.wpi_proto_ProtobufTransform2d_descriptor;
1389    }
1390
1391    private enum ProtobufTransform2dFactory implements MessageFactory<ProtobufTransform2d> {
1392      INSTANCE;
1393
1394      @Override
1395      public ProtobufTransform2d create() {
1396        return ProtobufTransform2d.newInstance();
1397      }
1398    }
1399
1400    /**
1401     * Contains name constants used for serializing JSON
1402     */
1403    static class FieldNames {
1404      static final FieldName translation = FieldName.forField("translation");
1405
1406      static final FieldName rotation = FieldName.forField("rotation");
1407    }
1408  }
1409
1410  /**
1411   * Protobuf type {@code ProtobufTwist2d}
1412   */
1413  public static final class ProtobufTwist2d extends ProtoMessage<ProtobufTwist2d> implements Cloneable {
1414    private static final long serialVersionUID = 0L;
1415
1416    /**
1417     * <code>optional double dx = 1;</code>
1418     */
1419    private double dx;
1420
1421    /**
1422     * <code>optional double dy = 2;</code>
1423     */
1424    private double dy;
1425
1426    /**
1427     * <code>optional double dtheta = 3;</code>
1428     */
1429    private double dtheta;
1430
1431    private ProtobufTwist2d() {
1432    }
1433
1434    /**
1435     * @return a new empty instance of {@code ProtobufTwist2d}
1436     */
1437    public static ProtobufTwist2d newInstance() {
1438      return new ProtobufTwist2d();
1439    }
1440
1441    /**
1442     * <code>optional double dx = 1;</code>
1443     * @return whether the dx field is set
1444     */
1445    public boolean hasDx() {
1446      return (bitField0_ & 0x00000001) != 0;
1447    }
1448
1449    /**
1450     * <code>optional double dx = 1;</code>
1451     * @return this
1452     */
1453    public ProtobufTwist2d clearDx() {
1454      bitField0_ &= ~0x00000001;
1455      dx = 0D;
1456      return this;
1457    }
1458
1459    /**
1460     * <code>optional double dx = 1;</code>
1461     * @return the dx
1462     */
1463    public double getDx() {
1464      return dx;
1465    }
1466
1467    /**
1468     * <code>optional double dx = 1;</code>
1469     * @param value the dx to set
1470     * @return this
1471     */
1472    public ProtobufTwist2d setDx(final double value) {
1473      bitField0_ |= 0x00000001;
1474      dx = value;
1475      return this;
1476    }
1477
1478    /**
1479     * <code>optional double dy = 2;</code>
1480     * @return whether the dy field is set
1481     */
1482    public boolean hasDy() {
1483      return (bitField0_ & 0x00000002) != 0;
1484    }
1485
1486    /**
1487     * <code>optional double dy = 2;</code>
1488     * @return this
1489     */
1490    public ProtobufTwist2d clearDy() {
1491      bitField0_ &= ~0x00000002;
1492      dy = 0D;
1493      return this;
1494    }
1495
1496    /**
1497     * <code>optional double dy = 2;</code>
1498     * @return the dy
1499     */
1500    public double getDy() {
1501      return dy;
1502    }
1503
1504    /**
1505     * <code>optional double dy = 2;</code>
1506     * @param value the dy to set
1507     * @return this
1508     */
1509    public ProtobufTwist2d setDy(final double value) {
1510      bitField0_ |= 0x00000002;
1511      dy = value;
1512      return this;
1513    }
1514
1515    /**
1516     * <code>optional double dtheta = 3;</code>
1517     * @return whether the dtheta field is set
1518     */
1519    public boolean hasDtheta() {
1520      return (bitField0_ & 0x00000004) != 0;
1521    }
1522
1523    /**
1524     * <code>optional double dtheta = 3;</code>
1525     * @return this
1526     */
1527    public ProtobufTwist2d clearDtheta() {
1528      bitField0_ &= ~0x00000004;
1529      dtheta = 0D;
1530      return this;
1531    }
1532
1533    /**
1534     * <code>optional double dtheta = 3;</code>
1535     * @return the dtheta
1536     */
1537    public double getDtheta() {
1538      return dtheta;
1539    }
1540
1541    /**
1542     * <code>optional double dtheta = 3;</code>
1543     * @param value the dtheta to set
1544     * @return this
1545     */
1546    public ProtobufTwist2d setDtheta(final double value) {
1547      bitField0_ |= 0x00000004;
1548      dtheta = value;
1549      return this;
1550    }
1551
1552    @Override
1553    public ProtobufTwist2d copyFrom(final ProtobufTwist2d other) {
1554      cachedSize = other.cachedSize;
1555      if ((bitField0_ | other.bitField0_) != 0) {
1556        bitField0_ = other.bitField0_;
1557        dx = other.dx;
1558        dy = other.dy;
1559        dtheta = other.dtheta;
1560      }
1561      return this;
1562    }
1563
1564    @Override
1565    public ProtobufTwist2d mergeFrom(final ProtobufTwist2d other) {
1566      if (other.isEmpty()) {
1567        return this;
1568      }
1569      cachedSize = -1;
1570      if (other.hasDx()) {
1571        setDx(other.dx);
1572      }
1573      if (other.hasDy()) {
1574        setDy(other.dy);
1575      }
1576      if (other.hasDtheta()) {
1577        setDtheta(other.dtheta);
1578      }
1579      return this;
1580    }
1581
1582    @Override
1583    public ProtobufTwist2d clear() {
1584      if (isEmpty()) {
1585        return this;
1586      }
1587      cachedSize = -1;
1588      bitField0_ = 0;
1589      dx = 0D;
1590      dy = 0D;
1591      dtheta = 0D;
1592      return this;
1593    }
1594
1595    @Override
1596    public ProtobufTwist2d clearQuick() {
1597      if (isEmpty()) {
1598        return this;
1599      }
1600      cachedSize = -1;
1601      bitField0_ = 0;
1602      return this;
1603    }
1604
1605    @Override
1606    public boolean equals(Object o) {
1607      if (o == this) {
1608        return true;
1609      }
1610      if (!(o instanceof ProtobufTwist2d)) {
1611        return false;
1612      }
1613      ProtobufTwist2d other = (ProtobufTwist2d) o;
1614      return bitField0_ == other.bitField0_
1615        && (!hasDx() || ProtoUtil.isEqual(dx, other.dx))
1616        && (!hasDy() || ProtoUtil.isEqual(dy, other.dy))
1617        && (!hasDtheta() || ProtoUtil.isEqual(dtheta, other.dtheta));
1618    }
1619
1620    @Override
1621    public void writeTo(final ProtoSink output) throws IOException {
1622      if ((bitField0_ & 0x00000001) != 0) {
1623        output.writeRawByte((byte) 9);
1624        output.writeDoubleNoTag(dx);
1625      }
1626      if ((bitField0_ & 0x00000002) != 0) {
1627        output.writeRawByte((byte) 17);
1628        output.writeDoubleNoTag(dy);
1629      }
1630      if ((bitField0_ & 0x00000004) != 0) {
1631        output.writeRawByte((byte) 25);
1632        output.writeDoubleNoTag(dtheta);
1633      }
1634    }
1635
1636    @Override
1637    protected int computeSerializedSize() {
1638      int size = 0;
1639      if ((bitField0_ & 0x00000001) != 0) {
1640        size += 9;
1641      }
1642      if ((bitField0_ & 0x00000002) != 0) {
1643        size += 9;
1644      }
1645      if ((bitField0_ & 0x00000004) != 0) {
1646        size += 9;
1647      }
1648      return size;
1649    }
1650
1651    @Override
1652    @SuppressWarnings("fallthrough")
1653    public ProtobufTwist2d mergeFrom(final ProtoSource input) throws IOException {
1654      // Enabled Fall-Through Optimization (QuickBuffers)
1655      int tag = input.readTag();
1656      while (true) {
1657        switch (tag) {
1658          case 9: {
1659            // dx
1660            dx = input.readDouble();
1661            bitField0_ |= 0x00000001;
1662            tag = input.readTag();
1663            if (tag != 17) {
1664              break;
1665            }
1666          }
1667          case 17: {
1668            // dy
1669            dy = input.readDouble();
1670            bitField0_ |= 0x00000002;
1671            tag = input.readTag();
1672            if (tag != 25) {
1673              break;
1674            }
1675          }
1676          case 25: {
1677            // dtheta
1678            dtheta = input.readDouble();
1679            bitField0_ |= 0x00000004;
1680            tag = input.readTag();
1681            if (tag != 0) {
1682              break;
1683            }
1684          }
1685          case 0: {
1686            return this;
1687          }
1688          default: {
1689            if (!input.skipField(tag)) {
1690              return this;
1691            }
1692            tag = input.readTag();
1693            break;
1694          }
1695        }
1696      }
1697    }
1698
1699    @Override
1700    public void writeTo(final JsonSink output) throws IOException {
1701      output.beginObject();
1702      if ((bitField0_ & 0x00000001) != 0) {
1703        output.writeDouble(FieldNames.dx, dx);
1704      }
1705      if ((bitField0_ & 0x00000002) != 0) {
1706        output.writeDouble(FieldNames.dy, dy);
1707      }
1708      if ((bitField0_ & 0x00000004) != 0) {
1709        output.writeDouble(FieldNames.dtheta, dtheta);
1710      }
1711      output.endObject();
1712    }
1713
1714    @Override
1715    public ProtobufTwist2d mergeFrom(final JsonSource input) throws IOException {
1716      if (!input.beginObject()) {
1717        return this;
1718      }
1719      while (!input.isAtEnd()) {
1720        switch (input.readFieldHash()) {
1721          case 3220: {
1722            if (input.isAtField(FieldNames.dx)) {
1723              if (!input.trySkipNullValue()) {
1724                dx = input.readDouble();
1725                bitField0_ |= 0x00000001;
1726              }
1727            } else {
1728              input.skipUnknownField();
1729            }
1730            break;
1731          }
1732          case 3221: {
1733            if (input.isAtField(FieldNames.dy)) {
1734              if (!input.trySkipNullValue()) {
1735                dy = input.readDouble();
1736                bitField0_ |= 0x00000002;
1737              }
1738            } else {
1739              input.skipUnknownField();
1740            }
1741            break;
1742          }
1743          case -1321724742: {
1744            if (input.isAtField(FieldNames.dtheta)) {
1745              if (!input.trySkipNullValue()) {
1746                dtheta = input.readDouble();
1747                bitField0_ |= 0x00000004;
1748              }
1749            } else {
1750              input.skipUnknownField();
1751            }
1752            break;
1753          }
1754          default: {
1755            input.skipUnknownField();
1756            break;
1757          }
1758        }
1759      }
1760      input.endObject();
1761      return this;
1762    }
1763
1764    @Override
1765    public ProtobufTwist2d clone() {
1766      return new ProtobufTwist2d().copyFrom(this);
1767    }
1768
1769    @Override
1770    public boolean isEmpty() {
1771      return ((bitField0_) == 0);
1772    }
1773
1774    public static ProtobufTwist2d parseFrom(final byte[] data) throws
1775        InvalidProtocolBufferException {
1776      return ProtoMessage.mergeFrom(new ProtobufTwist2d(), data).checkInitialized();
1777    }
1778
1779    public static ProtobufTwist2d parseFrom(final ProtoSource input) throws IOException {
1780      return ProtoMessage.mergeFrom(new ProtobufTwist2d(), input).checkInitialized();
1781    }
1782
1783    public static ProtobufTwist2d parseFrom(final JsonSource input) throws IOException {
1784      return ProtoMessage.mergeFrom(new ProtobufTwist2d(), input).checkInitialized();
1785    }
1786
1787    /**
1788     * @return factory for creating ProtobufTwist2d messages
1789     */
1790    public static MessageFactory<ProtobufTwist2d> getFactory() {
1791      return ProtobufTwist2dFactory.INSTANCE;
1792    }
1793
1794    /**
1795     * @return this type's descriptor.
1796     */
1797    public static Descriptors.Descriptor getDescriptor() {
1798      return Geometry2D.wpi_proto_ProtobufTwist2d_descriptor;
1799    }
1800
1801    private enum ProtobufTwist2dFactory implements MessageFactory<ProtobufTwist2d> {
1802      INSTANCE;
1803
1804      @Override
1805      public ProtobufTwist2d create() {
1806        return ProtobufTwist2d.newInstance();
1807      }
1808    }
1809
1810    /**
1811     * Contains name constants used for serializing JSON
1812     */
1813    static class FieldNames {
1814      static final FieldName dx = FieldName.forField("dx");
1815
1816      static final FieldName dy = FieldName.forField("dy");
1817
1818      static final FieldName dtheta = FieldName.forField("dtheta");
1819    }
1820  }
1821
1822  /**
1823   * Protobuf type {@code ProtobufRectangle2d}
1824   */
1825  public static final class ProtobufRectangle2d extends ProtoMessage<ProtobufRectangle2d> implements Cloneable {
1826    private static final long serialVersionUID = 0L;
1827
1828    /**
1829     * <code>optional double xWidth = 2;</code>
1830     */
1831    private double xWidth;
1832
1833    /**
1834     * <code>optional double yWidth = 3;</code>
1835     */
1836    private double yWidth;
1837
1838    /**
1839     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
1840     */
1841    private final ProtobufPose2d center = ProtobufPose2d.newInstance();
1842
1843    private ProtobufRectangle2d() {
1844    }
1845
1846    /**
1847     * @return a new empty instance of {@code ProtobufRectangle2d}
1848     */
1849    public static ProtobufRectangle2d newInstance() {
1850      return new ProtobufRectangle2d();
1851    }
1852
1853    /**
1854     * <code>optional double xWidth = 2;</code>
1855     * @return whether the xWidth field is set
1856     */
1857    public boolean hasXWidth() {
1858      return (bitField0_ & 0x00000001) != 0;
1859    }
1860
1861    /**
1862     * <code>optional double xWidth = 2;</code>
1863     * @return this
1864     */
1865    public ProtobufRectangle2d clearXWidth() {
1866      bitField0_ &= ~0x00000001;
1867      xWidth = 0D;
1868      return this;
1869    }
1870
1871    /**
1872     * <code>optional double xWidth = 2;</code>
1873     * @return the xWidth
1874     */
1875    public double getXWidth() {
1876      return xWidth;
1877    }
1878
1879    /**
1880     * <code>optional double xWidth = 2;</code>
1881     * @param value the xWidth to set
1882     * @return this
1883     */
1884    public ProtobufRectangle2d setXWidth(final double value) {
1885      bitField0_ |= 0x00000001;
1886      xWidth = value;
1887      return this;
1888    }
1889
1890    /**
1891     * <code>optional double yWidth = 3;</code>
1892     * @return whether the yWidth field is set
1893     */
1894    public boolean hasYWidth() {
1895      return (bitField0_ & 0x00000002) != 0;
1896    }
1897
1898    /**
1899     * <code>optional double yWidth = 3;</code>
1900     * @return this
1901     */
1902    public ProtobufRectangle2d clearYWidth() {
1903      bitField0_ &= ~0x00000002;
1904      yWidth = 0D;
1905      return this;
1906    }
1907
1908    /**
1909     * <code>optional double yWidth = 3;</code>
1910     * @return the yWidth
1911     */
1912    public double getYWidth() {
1913      return yWidth;
1914    }
1915
1916    /**
1917     * <code>optional double yWidth = 3;</code>
1918     * @param value the yWidth to set
1919     * @return this
1920     */
1921    public ProtobufRectangle2d setYWidth(final double value) {
1922      bitField0_ |= 0x00000002;
1923      yWidth = value;
1924      return this;
1925    }
1926
1927    /**
1928     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
1929     * @return whether the center field is set
1930     */
1931    public boolean hasCenter() {
1932      return (bitField0_ & 0x00000004) != 0;
1933    }
1934
1935    /**
1936     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
1937     * @return this
1938     */
1939    public ProtobufRectangle2d clearCenter() {
1940      bitField0_ &= ~0x00000004;
1941      center.clear();
1942      return this;
1943    }
1944
1945    /**
1946     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
1947     *
1948     * This method returns the internal storage object without modifying any has state.
1949     * The returned object should not be modified and be treated as read-only.
1950     *
1951     * Use {@link #getMutableCenter()} if you want to modify it.
1952     *
1953     * @return internal storage object for reading
1954     */
1955    public ProtobufPose2d getCenter() {
1956      return center;
1957    }
1958
1959    /**
1960     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
1961     *
1962     * This method returns the internal storage object and sets the corresponding
1963     * has state. The returned object will become part of this message and its
1964     * contents may be modified as long as the has state is not cleared.
1965     *
1966     * @return internal storage object for modifications
1967     */
1968    public ProtobufPose2d getMutableCenter() {
1969      bitField0_ |= 0x00000004;
1970      return center;
1971    }
1972
1973    /**
1974     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
1975     * @param value the center to set
1976     * @return this
1977     */
1978    public ProtobufRectangle2d setCenter(final ProtobufPose2d value) {
1979      bitField0_ |= 0x00000004;
1980      center.copyFrom(value);
1981      return this;
1982    }
1983
1984    @Override
1985    public ProtobufRectangle2d copyFrom(final ProtobufRectangle2d other) {
1986      cachedSize = other.cachedSize;
1987      if ((bitField0_ | other.bitField0_) != 0) {
1988        bitField0_ = other.bitField0_;
1989        xWidth = other.xWidth;
1990        yWidth = other.yWidth;
1991        center.copyFrom(other.center);
1992      }
1993      return this;
1994    }
1995
1996    @Override
1997    public ProtobufRectangle2d mergeFrom(final ProtobufRectangle2d other) {
1998      if (other.isEmpty()) {
1999        return this;
2000      }
2001      cachedSize = -1;
2002      if (other.hasXWidth()) {
2003        setXWidth(other.xWidth);
2004      }
2005      if (other.hasYWidth()) {
2006        setYWidth(other.yWidth);
2007      }
2008      if (other.hasCenter()) {
2009        getMutableCenter().mergeFrom(other.center);
2010      }
2011      return this;
2012    }
2013
2014    @Override
2015    public ProtobufRectangle2d clear() {
2016      if (isEmpty()) {
2017        return this;
2018      }
2019      cachedSize = -1;
2020      bitField0_ = 0;
2021      xWidth = 0D;
2022      yWidth = 0D;
2023      center.clear();
2024      return this;
2025    }
2026
2027    @Override
2028    public ProtobufRectangle2d clearQuick() {
2029      if (isEmpty()) {
2030        return this;
2031      }
2032      cachedSize = -1;
2033      bitField0_ = 0;
2034      center.clearQuick();
2035      return this;
2036    }
2037
2038    @Override
2039    public boolean equals(Object o) {
2040      if (o == this) {
2041        return true;
2042      }
2043      if (!(o instanceof ProtobufRectangle2d)) {
2044        return false;
2045      }
2046      ProtobufRectangle2d other = (ProtobufRectangle2d) o;
2047      return bitField0_ == other.bitField0_
2048        && (!hasXWidth() || ProtoUtil.isEqual(xWidth, other.xWidth))
2049        && (!hasYWidth() || ProtoUtil.isEqual(yWidth, other.yWidth))
2050        && (!hasCenter() || center.equals(other.center));
2051    }
2052
2053    @Override
2054    public void writeTo(final ProtoSink output) throws IOException {
2055      if ((bitField0_ & 0x00000001) != 0) {
2056        output.writeRawByte((byte) 17);
2057        output.writeDoubleNoTag(xWidth);
2058      }
2059      if ((bitField0_ & 0x00000002) != 0) {
2060        output.writeRawByte((byte) 25);
2061        output.writeDoubleNoTag(yWidth);
2062      }
2063      if ((bitField0_ & 0x00000004) != 0) {
2064        output.writeRawByte((byte) 10);
2065        output.writeMessageNoTag(center);
2066      }
2067    }
2068
2069    @Override
2070    protected int computeSerializedSize() {
2071      int size = 0;
2072      if ((bitField0_ & 0x00000001) != 0) {
2073        size += 9;
2074      }
2075      if ((bitField0_ & 0x00000002) != 0) {
2076        size += 9;
2077      }
2078      if ((bitField0_ & 0x00000004) != 0) {
2079        size += 1 + ProtoSink.computeMessageSizeNoTag(center);
2080      }
2081      return size;
2082    }
2083
2084    @Override
2085    @SuppressWarnings("fallthrough")
2086    public ProtobufRectangle2d mergeFrom(final ProtoSource input) throws IOException {
2087      // Enabled Fall-Through Optimization (QuickBuffers)
2088      int tag = input.readTag();
2089      while (true) {
2090        switch (tag) {
2091          case 17: {
2092            // xWidth
2093            xWidth = input.readDouble();
2094            bitField0_ |= 0x00000001;
2095            tag = input.readTag();
2096            if (tag != 25) {
2097              break;
2098            }
2099          }
2100          case 25: {
2101            // yWidth
2102            yWidth = input.readDouble();
2103            bitField0_ |= 0x00000002;
2104            tag = input.readTag();
2105            if (tag != 10) {
2106              break;
2107            }
2108          }
2109          case 10: {
2110            // center
2111            input.readMessage(center);
2112            bitField0_ |= 0x00000004;
2113            tag = input.readTag();
2114            if (tag != 0) {
2115              break;
2116            }
2117          }
2118          case 0: {
2119            return this;
2120          }
2121          default: {
2122            if (!input.skipField(tag)) {
2123              return this;
2124            }
2125            tag = input.readTag();
2126            break;
2127          }
2128        }
2129      }
2130    }
2131
2132    @Override
2133    public void writeTo(final JsonSink output) throws IOException {
2134      output.beginObject();
2135      if ((bitField0_ & 0x00000001) != 0) {
2136        output.writeDouble(FieldNames.xWidth, xWidth);
2137      }
2138      if ((bitField0_ & 0x00000002) != 0) {
2139        output.writeDouble(FieldNames.yWidth, yWidth);
2140      }
2141      if ((bitField0_ & 0x00000004) != 0) {
2142        output.writeMessage(FieldNames.center, center);
2143      }
2144      output.endObject();
2145    }
2146
2147    @Override
2148    public ProtobufRectangle2d mergeFrom(final JsonSource input) throws IOException {
2149      if (!input.beginObject()) {
2150        return this;
2151      }
2152      while (!input.isAtEnd()) {
2153        switch (input.readFieldHash()) {
2154          case -775894994: {
2155            if (input.isAtField(FieldNames.xWidth)) {
2156              if (!input.trySkipNullValue()) {
2157                xWidth = input.readDouble();
2158                bitField0_ |= 0x00000001;
2159              }
2160            } else {
2161              input.skipUnknownField();
2162            }
2163            break;
2164          }
2165          case -747265843: {
2166            if (input.isAtField(FieldNames.yWidth)) {
2167              if (!input.trySkipNullValue()) {
2168                yWidth = input.readDouble();
2169                bitField0_ |= 0x00000002;
2170              }
2171            } else {
2172              input.skipUnknownField();
2173            }
2174            break;
2175          }
2176          case -1364013995: {
2177            if (input.isAtField(FieldNames.center)) {
2178              if (!input.trySkipNullValue()) {
2179                input.readMessage(center);
2180                bitField0_ |= 0x00000004;
2181              }
2182            } else {
2183              input.skipUnknownField();
2184            }
2185            break;
2186          }
2187          default: {
2188            input.skipUnknownField();
2189            break;
2190          }
2191        }
2192      }
2193      input.endObject();
2194      return this;
2195    }
2196
2197    @Override
2198    public ProtobufRectangle2d clone() {
2199      return new ProtobufRectangle2d().copyFrom(this);
2200    }
2201
2202    @Override
2203    public boolean isEmpty() {
2204      return ((bitField0_) == 0);
2205    }
2206
2207    public static ProtobufRectangle2d parseFrom(final byte[] data) throws
2208        InvalidProtocolBufferException {
2209      return ProtoMessage.mergeFrom(new ProtobufRectangle2d(), data).checkInitialized();
2210    }
2211
2212    public static ProtobufRectangle2d parseFrom(final ProtoSource input) throws IOException {
2213      return ProtoMessage.mergeFrom(new ProtobufRectangle2d(), input).checkInitialized();
2214    }
2215
2216    public static ProtobufRectangle2d parseFrom(final JsonSource input) throws IOException {
2217      return ProtoMessage.mergeFrom(new ProtobufRectangle2d(), input).checkInitialized();
2218    }
2219
2220    /**
2221     * @return factory for creating ProtobufRectangle2d messages
2222     */
2223    public static MessageFactory<ProtobufRectangle2d> getFactory() {
2224      return ProtobufRectangle2dFactory.INSTANCE;
2225    }
2226
2227    /**
2228     * @return this type's descriptor.
2229     */
2230    public static Descriptors.Descriptor getDescriptor() {
2231      return Geometry2D.wpi_proto_ProtobufRectangle2d_descriptor;
2232    }
2233
2234    private enum ProtobufRectangle2dFactory implements MessageFactory<ProtobufRectangle2d> {
2235      INSTANCE;
2236
2237      @Override
2238      public ProtobufRectangle2d create() {
2239        return ProtobufRectangle2d.newInstance();
2240      }
2241    }
2242
2243    /**
2244     * Contains name constants used for serializing JSON
2245     */
2246    static class FieldNames {
2247      static final FieldName xWidth = FieldName.forField("xWidth");
2248
2249      static final FieldName yWidth = FieldName.forField("yWidth");
2250
2251      static final FieldName center = FieldName.forField("center");
2252    }
2253  }
2254
2255  /**
2256   * Protobuf type {@code ProtobufEllipse2d}
2257   */
2258  public static final class ProtobufEllipse2d extends ProtoMessage<ProtobufEllipse2d> implements Cloneable {
2259    private static final long serialVersionUID = 0L;
2260
2261    /**
2262     * <code>optional double xSemiAxis = 2;</code>
2263     */
2264    private double xSemiAxis;
2265
2266    /**
2267     * <code>optional double ySemiAxis = 3;</code>
2268     */
2269    private double ySemiAxis;
2270
2271    /**
2272     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
2273     */
2274    private final ProtobufPose2d center = ProtobufPose2d.newInstance();
2275
2276    private ProtobufEllipse2d() {
2277    }
2278
2279    /**
2280     * @return a new empty instance of {@code ProtobufEllipse2d}
2281     */
2282    public static ProtobufEllipse2d newInstance() {
2283      return new ProtobufEllipse2d();
2284    }
2285
2286    /**
2287     * <code>optional double xSemiAxis = 2;</code>
2288     * @return whether the xSemiAxis field is set
2289     */
2290    public boolean hasXSemiAxis() {
2291      return (bitField0_ & 0x00000001) != 0;
2292    }
2293
2294    /**
2295     * <code>optional double xSemiAxis = 2;</code>
2296     * @return this
2297     */
2298    public ProtobufEllipse2d clearXSemiAxis() {
2299      bitField0_ &= ~0x00000001;
2300      xSemiAxis = 0D;
2301      return this;
2302    }
2303
2304    /**
2305     * <code>optional double xSemiAxis = 2;</code>
2306     * @return the xSemiAxis
2307     */
2308    public double getXSemiAxis() {
2309      return xSemiAxis;
2310    }
2311
2312    /**
2313     * <code>optional double xSemiAxis = 2;</code>
2314     * @param value the xSemiAxis to set
2315     * @return this
2316     */
2317    public ProtobufEllipse2d setXSemiAxis(final double value) {
2318      bitField0_ |= 0x00000001;
2319      xSemiAxis = value;
2320      return this;
2321    }
2322
2323    /**
2324     * <code>optional double ySemiAxis = 3;</code>
2325     * @return whether the ySemiAxis field is set
2326     */
2327    public boolean hasYSemiAxis() {
2328      return (bitField0_ & 0x00000002) != 0;
2329    }
2330
2331    /**
2332     * <code>optional double ySemiAxis = 3;</code>
2333     * @return this
2334     */
2335    public ProtobufEllipse2d clearYSemiAxis() {
2336      bitField0_ &= ~0x00000002;
2337      ySemiAxis = 0D;
2338      return this;
2339    }
2340
2341    /**
2342     * <code>optional double ySemiAxis = 3;</code>
2343     * @return the ySemiAxis
2344     */
2345    public double getYSemiAxis() {
2346      return ySemiAxis;
2347    }
2348
2349    /**
2350     * <code>optional double ySemiAxis = 3;</code>
2351     * @param value the ySemiAxis to set
2352     * @return this
2353     */
2354    public ProtobufEllipse2d setYSemiAxis(final double value) {
2355      bitField0_ |= 0x00000002;
2356      ySemiAxis = value;
2357      return this;
2358    }
2359
2360    /**
2361     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
2362     * @return whether the center field is set
2363     */
2364    public boolean hasCenter() {
2365      return (bitField0_ & 0x00000004) != 0;
2366    }
2367
2368    /**
2369     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
2370     * @return this
2371     */
2372    public ProtobufEllipse2d clearCenter() {
2373      bitField0_ &= ~0x00000004;
2374      center.clear();
2375      return this;
2376    }
2377
2378    /**
2379     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
2380     *
2381     * This method returns the internal storage object without modifying any has state.
2382     * The returned object should not be modified and be treated as read-only.
2383     *
2384     * Use {@link #getMutableCenter()} if you want to modify it.
2385     *
2386     * @return internal storage object for reading
2387     */
2388    public ProtobufPose2d getCenter() {
2389      return center;
2390    }
2391
2392    /**
2393     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
2394     *
2395     * This method returns the internal storage object and sets the corresponding
2396     * has state. The returned object will become part of this message and its
2397     * contents may be modified as long as the has state is not cleared.
2398     *
2399     * @return internal storage object for modifications
2400     */
2401    public ProtobufPose2d getMutableCenter() {
2402      bitField0_ |= 0x00000004;
2403      return center;
2404    }
2405
2406    /**
2407     * <code>optional .wpi.proto.ProtobufPose2d center = 1;</code>
2408     * @param value the center to set
2409     * @return this
2410     */
2411    public ProtobufEllipse2d setCenter(final ProtobufPose2d value) {
2412      bitField0_ |= 0x00000004;
2413      center.copyFrom(value);
2414      return this;
2415    }
2416
2417    @Override
2418    public ProtobufEllipse2d copyFrom(final ProtobufEllipse2d other) {
2419      cachedSize = other.cachedSize;
2420      if ((bitField0_ | other.bitField0_) != 0) {
2421        bitField0_ = other.bitField0_;
2422        xSemiAxis = other.xSemiAxis;
2423        ySemiAxis = other.ySemiAxis;
2424        center.copyFrom(other.center);
2425      }
2426      return this;
2427    }
2428
2429    @Override
2430    public ProtobufEllipse2d mergeFrom(final ProtobufEllipse2d other) {
2431      if (other.isEmpty()) {
2432        return this;
2433      }
2434      cachedSize = -1;
2435      if (other.hasXSemiAxis()) {
2436        setXSemiAxis(other.xSemiAxis);
2437      }
2438      if (other.hasYSemiAxis()) {
2439        setYSemiAxis(other.ySemiAxis);
2440      }
2441      if (other.hasCenter()) {
2442        getMutableCenter().mergeFrom(other.center);
2443      }
2444      return this;
2445    }
2446
2447    @Override
2448    public ProtobufEllipse2d clear() {
2449      if (isEmpty()) {
2450        return this;
2451      }
2452      cachedSize = -1;
2453      bitField0_ = 0;
2454      xSemiAxis = 0D;
2455      ySemiAxis = 0D;
2456      center.clear();
2457      return this;
2458    }
2459
2460    @Override
2461    public ProtobufEllipse2d clearQuick() {
2462      if (isEmpty()) {
2463        return this;
2464      }
2465      cachedSize = -1;
2466      bitField0_ = 0;
2467      center.clearQuick();
2468      return this;
2469    }
2470
2471    @Override
2472    public boolean equals(Object o) {
2473      if (o == this) {
2474        return true;
2475      }
2476      if (!(o instanceof ProtobufEllipse2d)) {
2477        return false;
2478      }
2479      ProtobufEllipse2d other = (ProtobufEllipse2d) o;
2480      return bitField0_ == other.bitField0_
2481        && (!hasXSemiAxis() || ProtoUtil.isEqual(xSemiAxis, other.xSemiAxis))
2482        && (!hasYSemiAxis() || ProtoUtil.isEqual(ySemiAxis, other.ySemiAxis))
2483        && (!hasCenter() || center.equals(other.center));
2484    }
2485
2486    @Override
2487    public void writeTo(final ProtoSink output) throws IOException {
2488      if ((bitField0_ & 0x00000001) != 0) {
2489        output.writeRawByte((byte) 17);
2490        output.writeDoubleNoTag(xSemiAxis);
2491      }
2492      if ((bitField0_ & 0x00000002) != 0) {
2493        output.writeRawByte((byte) 25);
2494        output.writeDoubleNoTag(ySemiAxis);
2495      }
2496      if ((bitField0_ & 0x00000004) != 0) {
2497        output.writeRawByte((byte) 10);
2498        output.writeMessageNoTag(center);
2499      }
2500    }
2501
2502    @Override
2503    protected int computeSerializedSize() {
2504      int size = 0;
2505      if ((bitField0_ & 0x00000001) != 0) {
2506        size += 9;
2507      }
2508      if ((bitField0_ & 0x00000002) != 0) {
2509        size += 9;
2510      }
2511      if ((bitField0_ & 0x00000004) != 0) {
2512        size += 1 + ProtoSink.computeMessageSizeNoTag(center);
2513      }
2514      return size;
2515    }
2516
2517    @Override
2518    @SuppressWarnings("fallthrough")
2519    public ProtobufEllipse2d mergeFrom(final ProtoSource input) throws IOException {
2520      // Enabled Fall-Through Optimization (QuickBuffers)
2521      int tag = input.readTag();
2522      while (true) {
2523        switch (tag) {
2524          case 17: {
2525            // xSemiAxis
2526            xSemiAxis = input.readDouble();
2527            bitField0_ |= 0x00000001;
2528            tag = input.readTag();
2529            if (tag != 25) {
2530              break;
2531            }
2532          }
2533          case 25: {
2534            // ySemiAxis
2535            ySemiAxis = input.readDouble();
2536            bitField0_ |= 0x00000002;
2537            tag = input.readTag();
2538            if (tag != 10) {
2539              break;
2540            }
2541          }
2542          case 10: {
2543            // center
2544            input.readMessage(center);
2545            bitField0_ |= 0x00000004;
2546            tag = input.readTag();
2547            if (tag != 0) {
2548              break;
2549            }
2550          }
2551          case 0: {
2552            return this;
2553          }
2554          default: {
2555            if (!input.skipField(tag)) {
2556              return this;
2557            }
2558            tag = input.readTag();
2559            break;
2560          }
2561        }
2562      }
2563    }
2564
2565    @Override
2566    public void writeTo(final JsonSink output) throws IOException {
2567      output.beginObject();
2568      if ((bitField0_ & 0x00000001) != 0) {
2569        output.writeDouble(FieldNames.xSemiAxis, xSemiAxis);
2570      }
2571      if ((bitField0_ & 0x00000002) != 0) {
2572        output.writeDouble(FieldNames.ySemiAxis, ySemiAxis);
2573      }
2574      if ((bitField0_ & 0x00000004) != 0) {
2575        output.writeMessage(FieldNames.center, center);
2576      }
2577      output.endObject();
2578    }
2579
2580    @Override
2581    public ProtobufEllipse2d mergeFrom(final JsonSource input) throws IOException {
2582      if (!input.beginObject()) {
2583        return this;
2584      }
2585      while (!input.isAtEnd()) {
2586        switch (input.readFieldHash()) {
2587          case -858640185: {
2588            if (input.isAtField(FieldNames.xSemiAxis)) {
2589              if (!input.trySkipNullValue()) {
2590                xSemiAxis = input.readDouble();
2591                bitField0_ |= 0x00000001;
2592              }
2593            } else {
2594              input.skipUnknownField();
2595            }
2596            break;
2597          }
2598          case 1628872648: {
2599            if (input.isAtField(FieldNames.ySemiAxis)) {
2600              if (!input.trySkipNullValue()) {
2601                ySemiAxis = input.readDouble();
2602                bitField0_ |= 0x00000002;
2603              }
2604            } else {
2605              input.skipUnknownField();
2606            }
2607            break;
2608          }
2609          case -1364013995: {
2610            if (input.isAtField(FieldNames.center)) {
2611              if (!input.trySkipNullValue()) {
2612                input.readMessage(center);
2613                bitField0_ |= 0x00000004;
2614              }
2615            } else {
2616              input.skipUnknownField();
2617            }
2618            break;
2619          }
2620          default: {
2621            input.skipUnknownField();
2622            break;
2623          }
2624        }
2625      }
2626      input.endObject();
2627      return this;
2628    }
2629
2630    @Override
2631    public ProtobufEllipse2d clone() {
2632      return new ProtobufEllipse2d().copyFrom(this);
2633    }
2634
2635    @Override
2636    public boolean isEmpty() {
2637      return ((bitField0_) == 0);
2638    }
2639
2640    public static ProtobufEllipse2d parseFrom(final byte[] data) throws
2641        InvalidProtocolBufferException {
2642      return ProtoMessage.mergeFrom(new ProtobufEllipse2d(), data).checkInitialized();
2643    }
2644
2645    public static ProtobufEllipse2d parseFrom(final ProtoSource input) throws IOException {
2646      return ProtoMessage.mergeFrom(new ProtobufEllipse2d(), input).checkInitialized();
2647    }
2648
2649    public static ProtobufEllipse2d parseFrom(final JsonSource input) throws IOException {
2650      return ProtoMessage.mergeFrom(new ProtobufEllipse2d(), input).checkInitialized();
2651    }
2652
2653    /**
2654     * @return factory for creating ProtobufEllipse2d messages
2655     */
2656    public static MessageFactory<ProtobufEllipse2d> getFactory() {
2657      return ProtobufEllipse2dFactory.INSTANCE;
2658    }
2659
2660    /**
2661     * @return this type's descriptor.
2662     */
2663    public static Descriptors.Descriptor getDescriptor() {
2664      return Geometry2D.wpi_proto_ProtobufEllipse2d_descriptor;
2665    }
2666
2667    private enum ProtobufEllipse2dFactory implements MessageFactory<ProtobufEllipse2d> {
2668      INSTANCE;
2669
2670      @Override
2671      public ProtobufEllipse2d create() {
2672        return ProtobufEllipse2d.newInstance();
2673      }
2674    }
2675
2676    /**
2677     * Contains name constants used for serializing JSON
2678     */
2679    static class FieldNames {
2680      static final FieldName xSemiAxis = FieldName.forField("xSemiAxis");
2681
2682      static final FieldName ySemiAxis = FieldName.forField("ySemiAxis");
2683
2684      static final FieldName center = FieldName.forField("center");
2685    }
2686  }
2687}