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;
019import us.hebi.quickbuf.RepeatedDouble;
020
021public final class Spline {
022  private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(993,
023    "CgxzcGxpbmUucHJvdG8SCXdwaS5wcm90byKIAQoaUHJvdG9idWZDdWJpY0hlcm1pdGVTcGxpbmUSGwoJ" + 
024    "eF9pbml0aWFsGAEgAygBUgh4SW5pdGlhbBIXCgd4X2ZpbmFsGAIgAygBUgZ4RmluYWwSGwoJeV9pbml0" + 
025    "aWFsGAMgAygBUgh5SW5pdGlhbBIXCgd5X2ZpbmFsGAQgAygBUgZ5RmluYWwiigEKHFByb3RvYnVmUXVp" + 
026    "bnRpY0hlcm1pdGVTcGxpbmUSGwoJeF9pbml0aWFsGAEgAygBUgh4SW5pdGlhbBIXCgd4X2ZpbmFsGAIg" + 
027    "AygBUgZ4RmluYWwSGwoJeV9pbml0aWFsGAMgAygBUgh5SW5pdGlhbBIXCgd5X2ZpbmFsGAQgAygBUgZ5" + 
028    "RmluYWxCGgoYZWR1LndwaS5maXJzdC5tYXRoLnByb3RvSokFCgYSBAAAEgEKCAoBDBIDAAASCggKAQIS" + 
029    "AwIAEgoICgEIEgMEADEKCQoCCAESAwQAMQoKCgIEABIEBgALAQoKCgMEAAESAwYIIgoLCgQEAAIAEgMH" + 
030    "AiAKDAoFBAACAAQSAwcCCgoMCgUEAAIABRIDBwsRCgwKBQQAAgABEgMHEhsKDAoFBAACAAMSAwceHwoL" + 
031    "CgQEAAIBEgMIAh4KDAoFBAACAQQSAwgCCgoMCgUEAAIBBRIDCAsRCgwKBQQAAgEBEgMIEhkKDAoFBAAC" + 
032    "AQMSAwgcHQoLCgQEAAICEgMJAiAKDAoFBAACAgQSAwkCCgoMCgUEAAICBRIDCQsRCgwKBQQAAgIBEgMJ" + 
033    "EhsKDAoFBAACAgMSAwkeHwoLCgQEAAIDEgMKAh4KDAoFBAACAwQSAwoCCgoMCgUEAAIDBRIDCgsRCgwK" + 
034    "BQQAAgMBEgMKEhkKDAoFBAACAwMSAwocHQoKCgIEARIEDQASAQoKCgMEAQESAw0IJAoLCgQEAQIAEgMO" + 
035    "AiAKDAoFBAECAAQSAw4CCgoMCgUEAQIABRIDDgsRCgwKBQQBAgABEgMOEhsKDAoFBAECAAMSAw4eHwoL" + 
036    "CgQEAQIBEgMPAh4KDAoFBAECAQQSAw8CCgoMCgUEAQIBBRIDDwsRCgwKBQQBAgEBEgMPEhkKDAoFBAEC" + 
037    "AQMSAw8cHQoLCgQEAQICEgMQAiAKDAoFBAECAgQSAxACCgoMCgUEAQICBRIDEAsRCgwKBQQBAgIBEgMQ" + 
038    "EhsKDAoFBAECAgMSAxAeHwoLCgQEAQIDEgMRAh4KDAoFBAECAwQSAxECCgoMCgUEAQIDBRIDEQsRCgwK" + 
039    "BQQBAgMBEgMREhkKDAoFBAECAwMSAxEcHWIGcHJvdG8z");
040
041  static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("spline.proto", "wpi.proto", descriptorData);
042
043  static final Descriptors.Descriptor wpi_proto_ProtobufCubicHermiteSpline_descriptor = descriptor.internalContainedType(28, 136, "ProtobufCubicHermiteSpline", "wpi.proto.ProtobufCubicHermiteSpline");
044
045  static final Descriptors.Descriptor wpi_proto_ProtobufQuinticHermiteSpline_descriptor = descriptor.internalContainedType(167, 138, "ProtobufQuinticHermiteSpline", "wpi.proto.ProtobufQuinticHermiteSpline");
046
047  /**
048   * @return this proto file's descriptor.
049   */
050  public static Descriptors.FileDescriptor getDescriptor() {
051    return descriptor;
052  }
053
054  /**
055   * Protobuf type {@code ProtobufCubicHermiteSpline}
056   */
057  public static final class ProtobufCubicHermiteSpline extends ProtoMessage<ProtobufCubicHermiteSpline> implements Cloneable {
058    private static final long serialVersionUID = 0L;
059
060    /**
061     * <code>repeated double x_initial = 1;</code>
062     */
063    private final RepeatedDouble xInitial = RepeatedDouble.newEmptyInstance();
064
065    /**
066     * <code>repeated double x_final = 2;</code>
067     */
068    private final RepeatedDouble xFinal = RepeatedDouble.newEmptyInstance();
069
070    /**
071     * <code>repeated double y_initial = 3;</code>
072     */
073    private final RepeatedDouble yInitial = RepeatedDouble.newEmptyInstance();
074
075    /**
076     * <code>repeated double y_final = 4;</code>
077     */
078    private final RepeatedDouble yFinal = RepeatedDouble.newEmptyInstance();
079
080    private ProtobufCubicHermiteSpline() {
081    }
082
083    /**
084     * @return a new empty instance of {@code ProtobufCubicHermiteSpline}
085     */
086    public static ProtobufCubicHermiteSpline newInstance() {
087      return new ProtobufCubicHermiteSpline();
088    }
089
090    /**
091     * <code>repeated double x_initial = 1;</code>
092     * @return whether the xInitial field is set
093     */
094    public boolean hasXInitial() {
095      return (bitField0_ & 0x00000001) != 0;
096    }
097
098    /**
099     * <code>repeated double x_initial = 1;</code>
100     * @return this
101     */
102    public ProtobufCubicHermiteSpline clearXInitial() {
103      bitField0_ &= ~0x00000001;
104      xInitial.clear();
105      return this;
106    }
107
108    /**
109     * <code>repeated double x_initial = 1;</code>
110     *
111     * This method returns the internal storage object without modifying any has state.
112     * The returned object should not be modified and be treated as read-only.
113     *
114     * Use {@link #getMutableXInitial()} if you want to modify it.
115     *
116     * @return internal storage object for reading
117     */
118    public RepeatedDouble getXInitial() {
119      return xInitial;
120    }
121
122    /**
123     * <code>repeated double x_initial = 1;</code>
124     *
125     * This method returns the internal storage object and sets the corresponding
126     * has state. The returned object will become part of this message and its
127     * contents may be modified as long as the has state is not cleared.
128     *
129     * @return internal storage object for modifications
130     */
131    public RepeatedDouble getMutableXInitial() {
132      bitField0_ |= 0x00000001;
133      return xInitial;
134    }
135
136    /**
137     * <code>repeated double x_initial = 1;</code>
138     * @param value the xInitial to add
139     * @return this
140     */
141    public ProtobufCubicHermiteSpline addXInitial(final double value) {
142      bitField0_ |= 0x00000001;
143      xInitial.add(value);
144      return this;
145    }
146
147    /**
148     * <code>repeated double x_initial = 1;</code>
149     * @param values the xInitial to add
150     * @return this
151     */
152    public ProtobufCubicHermiteSpline addAllXInitial(final double... values) {
153      bitField0_ |= 0x00000001;
154      xInitial.addAll(values);
155      return this;
156    }
157
158    /**
159     * <code>repeated double x_final = 2;</code>
160     * @return whether the xFinal field is set
161     */
162    public boolean hasXFinal() {
163      return (bitField0_ & 0x00000002) != 0;
164    }
165
166    /**
167     * <code>repeated double x_final = 2;</code>
168     * @return this
169     */
170    public ProtobufCubicHermiteSpline clearXFinal() {
171      bitField0_ &= ~0x00000002;
172      xFinal.clear();
173      return this;
174    }
175
176    /**
177     * <code>repeated double x_final = 2;</code>
178     *
179     * This method returns the internal storage object without modifying any has state.
180     * The returned object should not be modified and be treated as read-only.
181     *
182     * Use {@link #getMutableXFinal()} if you want to modify it.
183     *
184     * @return internal storage object for reading
185     */
186    public RepeatedDouble getXFinal() {
187      return xFinal;
188    }
189
190    /**
191     * <code>repeated double x_final = 2;</code>
192     *
193     * This method returns the internal storage object and sets the corresponding
194     * has state. The returned object will become part of this message and its
195     * contents may be modified as long as the has state is not cleared.
196     *
197     * @return internal storage object for modifications
198     */
199    public RepeatedDouble getMutableXFinal() {
200      bitField0_ |= 0x00000002;
201      return xFinal;
202    }
203
204    /**
205     * <code>repeated double x_final = 2;</code>
206     * @param value the xFinal to add
207     * @return this
208     */
209    public ProtobufCubicHermiteSpline addXFinal(final double value) {
210      bitField0_ |= 0x00000002;
211      xFinal.add(value);
212      return this;
213    }
214
215    /**
216     * <code>repeated double x_final = 2;</code>
217     * @param values the xFinal to add
218     * @return this
219     */
220    public ProtobufCubicHermiteSpline addAllXFinal(final double... values) {
221      bitField0_ |= 0x00000002;
222      xFinal.addAll(values);
223      return this;
224    }
225
226    /**
227     * <code>repeated double y_initial = 3;</code>
228     * @return whether the yInitial field is set
229     */
230    public boolean hasYInitial() {
231      return (bitField0_ & 0x00000004) != 0;
232    }
233
234    /**
235     * <code>repeated double y_initial = 3;</code>
236     * @return this
237     */
238    public ProtobufCubicHermiteSpline clearYInitial() {
239      bitField0_ &= ~0x00000004;
240      yInitial.clear();
241      return this;
242    }
243
244    /**
245     * <code>repeated double y_initial = 3;</code>
246     *
247     * This method returns the internal storage object without modifying any has state.
248     * The returned object should not be modified and be treated as read-only.
249     *
250     * Use {@link #getMutableYInitial()} if you want to modify it.
251     *
252     * @return internal storage object for reading
253     */
254    public RepeatedDouble getYInitial() {
255      return yInitial;
256    }
257
258    /**
259     * <code>repeated double y_initial = 3;</code>
260     *
261     * This method returns the internal storage object and sets the corresponding
262     * has state. The returned object will become part of this message and its
263     * contents may be modified as long as the has state is not cleared.
264     *
265     * @return internal storage object for modifications
266     */
267    public RepeatedDouble getMutableYInitial() {
268      bitField0_ |= 0x00000004;
269      return yInitial;
270    }
271
272    /**
273     * <code>repeated double y_initial = 3;</code>
274     * @param value the yInitial to add
275     * @return this
276     */
277    public ProtobufCubicHermiteSpline addYInitial(final double value) {
278      bitField0_ |= 0x00000004;
279      yInitial.add(value);
280      return this;
281    }
282
283    /**
284     * <code>repeated double y_initial = 3;</code>
285     * @param values the yInitial to add
286     * @return this
287     */
288    public ProtobufCubicHermiteSpline addAllYInitial(final double... values) {
289      bitField0_ |= 0x00000004;
290      yInitial.addAll(values);
291      return this;
292    }
293
294    /**
295     * <code>repeated double y_final = 4;</code>
296     * @return whether the yFinal field is set
297     */
298    public boolean hasYFinal() {
299      return (bitField0_ & 0x00000008) != 0;
300    }
301
302    /**
303     * <code>repeated double y_final = 4;</code>
304     * @return this
305     */
306    public ProtobufCubicHermiteSpline clearYFinal() {
307      bitField0_ &= ~0x00000008;
308      yFinal.clear();
309      return this;
310    }
311
312    /**
313     * <code>repeated double y_final = 4;</code>
314     *
315     * This method returns the internal storage object without modifying any has state.
316     * The returned object should not be modified and be treated as read-only.
317     *
318     * Use {@link #getMutableYFinal()} if you want to modify it.
319     *
320     * @return internal storage object for reading
321     */
322    public RepeatedDouble getYFinal() {
323      return yFinal;
324    }
325
326    /**
327     * <code>repeated double y_final = 4;</code>
328     *
329     * This method returns the internal storage object and sets the corresponding
330     * has state. The returned object will become part of this message and its
331     * contents may be modified as long as the has state is not cleared.
332     *
333     * @return internal storage object for modifications
334     */
335    public RepeatedDouble getMutableYFinal() {
336      bitField0_ |= 0x00000008;
337      return yFinal;
338    }
339
340    /**
341     * <code>repeated double y_final = 4;</code>
342     * @param value the yFinal to add
343     * @return this
344     */
345    public ProtobufCubicHermiteSpline addYFinal(final double value) {
346      bitField0_ |= 0x00000008;
347      yFinal.add(value);
348      return this;
349    }
350
351    /**
352     * <code>repeated double y_final = 4;</code>
353     * @param values the yFinal to add
354     * @return this
355     */
356    public ProtobufCubicHermiteSpline addAllYFinal(final double... values) {
357      bitField0_ |= 0x00000008;
358      yFinal.addAll(values);
359      return this;
360    }
361
362    @Override
363    public ProtobufCubicHermiteSpline copyFrom(final ProtobufCubicHermiteSpline other) {
364      cachedSize = other.cachedSize;
365      if ((bitField0_ | other.bitField0_) != 0) {
366        bitField0_ = other.bitField0_;
367        xInitial.copyFrom(other.xInitial);
368        xFinal.copyFrom(other.xFinal);
369        yInitial.copyFrom(other.yInitial);
370        yFinal.copyFrom(other.yFinal);
371      }
372      return this;
373    }
374
375    @Override
376    public ProtobufCubicHermiteSpline mergeFrom(final ProtobufCubicHermiteSpline other) {
377      if (other.isEmpty()) {
378        return this;
379      }
380      cachedSize = -1;
381      if (other.hasXInitial()) {
382        getMutableXInitial().addAll(other.xInitial);
383      }
384      if (other.hasXFinal()) {
385        getMutableXFinal().addAll(other.xFinal);
386      }
387      if (other.hasYInitial()) {
388        getMutableYInitial().addAll(other.yInitial);
389      }
390      if (other.hasYFinal()) {
391        getMutableYFinal().addAll(other.yFinal);
392      }
393      return this;
394    }
395
396    @Override
397    public ProtobufCubicHermiteSpline clear() {
398      if (isEmpty()) {
399        return this;
400      }
401      cachedSize = -1;
402      bitField0_ = 0;
403      xInitial.clear();
404      xFinal.clear();
405      yInitial.clear();
406      yFinal.clear();
407      return this;
408    }
409
410    @Override
411    public ProtobufCubicHermiteSpline clearQuick() {
412      if (isEmpty()) {
413        return this;
414      }
415      cachedSize = -1;
416      bitField0_ = 0;
417      xInitial.clear();
418      xFinal.clear();
419      yInitial.clear();
420      yFinal.clear();
421      return this;
422    }
423
424    @Override
425    public boolean equals(Object o) {
426      if (o == this) {
427        return true;
428      }
429      if (!(o instanceof ProtobufCubicHermiteSpline)) {
430        return false;
431      }
432      ProtobufCubicHermiteSpline other = (ProtobufCubicHermiteSpline) o;
433      return bitField0_ == other.bitField0_
434        && (!hasXInitial() || xInitial.equals(other.xInitial))
435        && (!hasXFinal() || xFinal.equals(other.xFinal))
436        && (!hasYInitial() || yInitial.equals(other.yInitial))
437        && (!hasYFinal() || yFinal.equals(other.yFinal));
438    }
439
440    @Override
441    public void writeTo(final ProtoSink output) throws IOException {
442      if ((bitField0_ & 0x00000001) != 0) {
443        for (int i = 0; i < xInitial.length(); i++) {
444          output.writeRawByte((byte) 9);
445          output.writeDoubleNoTag(xInitial.array()[i]);
446        }
447      }
448      if ((bitField0_ & 0x00000002) != 0) {
449        for (int i = 0; i < xFinal.length(); i++) {
450          output.writeRawByte((byte) 17);
451          output.writeDoubleNoTag(xFinal.array()[i]);
452        }
453      }
454      if ((bitField0_ & 0x00000004) != 0) {
455        for (int i = 0; i < yInitial.length(); i++) {
456          output.writeRawByte((byte) 25);
457          output.writeDoubleNoTag(yInitial.array()[i]);
458        }
459      }
460      if ((bitField0_ & 0x00000008) != 0) {
461        for (int i = 0; i < yFinal.length(); i++) {
462          output.writeRawByte((byte) 33);
463          output.writeDoubleNoTag(yFinal.array()[i]);
464        }
465      }
466    }
467
468    @Override
469    protected int computeSerializedSize() {
470      int size = 0;
471      if ((bitField0_ & 0x00000001) != 0) {
472        size += (1 + 8) * xInitial.length();
473      }
474      if ((bitField0_ & 0x00000002) != 0) {
475        size += (1 + 8) * xFinal.length();
476      }
477      if ((bitField0_ & 0x00000004) != 0) {
478        size += (1 + 8) * yInitial.length();
479      }
480      if ((bitField0_ & 0x00000008) != 0) {
481        size += (1 + 8) * yFinal.length();
482      }
483      return size;
484    }
485
486    @Override
487    @SuppressWarnings("fallthrough")
488    public ProtobufCubicHermiteSpline mergeFrom(final ProtoSource input) throws IOException {
489      // Enabled Fall-Through Optimization (QuickBuffers)
490      int tag = input.readTag();
491      while (true) {
492        switch (tag) {
493          case 10: {
494            // xInitial [packed=true]
495            input.readPackedDouble(xInitial);
496            bitField0_ |= 0x00000001;
497            tag = input.readTag();
498            if (tag != 18) {
499              break;
500            }
501          }
502          case 18: {
503            // xFinal [packed=true]
504            input.readPackedDouble(xFinal);
505            bitField0_ |= 0x00000002;
506            tag = input.readTag();
507            if (tag != 26) {
508              break;
509            }
510          }
511          case 26: {
512            // yInitial [packed=true]
513            input.readPackedDouble(yInitial);
514            bitField0_ |= 0x00000004;
515            tag = input.readTag();
516            if (tag != 34) {
517              break;
518            }
519          }
520          case 34: {
521            // yFinal [packed=true]
522            input.readPackedDouble(yFinal);
523            bitField0_ |= 0x00000008;
524            tag = input.readTag();
525            if (tag != 0) {
526              break;
527            }
528          }
529          case 0: {
530            return this;
531          }
532          default: {
533            if (!input.skipField(tag)) {
534              return this;
535            }
536            tag = input.readTag();
537            break;
538          }
539          case 9: {
540            // xInitial [packed=false]
541            tag = input.readRepeatedDouble(xInitial, tag);
542            bitField0_ |= 0x00000001;
543            break;
544          }
545          case 17: {
546            // xFinal [packed=false]
547            tag = input.readRepeatedDouble(xFinal, tag);
548            bitField0_ |= 0x00000002;
549            break;
550          }
551          case 25: {
552            // yInitial [packed=false]
553            tag = input.readRepeatedDouble(yInitial, tag);
554            bitField0_ |= 0x00000004;
555            break;
556          }
557          case 33: {
558            // yFinal [packed=false]
559            tag = input.readRepeatedDouble(yFinal, tag);
560            bitField0_ |= 0x00000008;
561            break;
562          }
563        }
564      }
565    }
566
567    @Override
568    public void writeTo(final JsonSink output) throws IOException {
569      output.beginObject();
570      if ((bitField0_ & 0x00000001) != 0) {
571        output.writeRepeatedDouble(FieldNames.xInitial, xInitial);
572      }
573      if ((bitField0_ & 0x00000002) != 0) {
574        output.writeRepeatedDouble(FieldNames.xFinal, xFinal);
575      }
576      if ((bitField0_ & 0x00000004) != 0) {
577        output.writeRepeatedDouble(FieldNames.yInitial, yInitial);
578      }
579      if ((bitField0_ & 0x00000008) != 0) {
580        output.writeRepeatedDouble(FieldNames.yFinal, yFinal);
581      }
582      output.endObject();
583    }
584
585    @Override
586    public ProtobufCubicHermiteSpline mergeFrom(final JsonSource input) throws IOException {
587      if (!input.beginObject()) {
588        return this;
589      }
590      while (!input.isAtEnd()) {
591        switch (input.readFieldHash()) {
592          case -1998129236:
593          case -2134571395: {
594            if (input.isAtField(FieldNames.xInitial)) {
595              if (!input.trySkipNullValue()) {
596                input.readRepeatedDouble(xInitial);
597                bitField0_ |= 0x00000001;
598              }
599            } else {
600              input.skipUnknownField();
601            }
602            break;
603          }
604          case -791585826:
605          case 1943464687: {
606            if (input.isAtField(FieldNames.xFinal)) {
607              if (!input.trySkipNullValue()) {
608                input.readRepeatedDouble(xFinal);
609                bitField0_ |= 0x00000002;
610              }
611            } else {
612              input.skipUnknownField();
613            }
614            break;
615          }
616          case -255318901:
617          case 352941438: {
618            if (input.isAtField(FieldNames.yInitial)) {
619              if (!input.trySkipNullValue()) {
620                input.readRepeatedDouble(yInitial);
621                bitField0_ |= 0x00000004;
622              }
623            } else {
624              input.skipUnknownField();
625            }
626            break;
627          }
628          case -762956675:
629          case -1463998928: {
630            if (input.isAtField(FieldNames.yFinal)) {
631              if (!input.trySkipNullValue()) {
632                input.readRepeatedDouble(yFinal);
633                bitField0_ |= 0x00000008;
634              }
635            } else {
636              input.skipUnknownField();
637            }
638            break;
639          }
640          default: {
641            input.skipUnknownField();
642            break;
643          }
644        }
645      }
646      input.endObject();
647      return this;
648    }
649
650    @Override
651    public ProtobufCubicHermiteSpline clone() {
652      return new ProtobufCubicHermiteSpline().copyFrom(this);
653    }
654
655    @Override
656    public boolean isEmpty() {
657      return ((bitField0_) == 0);
658    }
659
660    public static ProtobufCubicHermiteSpline parseFrom(final byte[] data) throws
661        InvalidProtocolBufferException {
662      return ProtoMessage.mergeFrom(new ProtobufCubicHermiteSpline(), data).checkInitialized();
663    }
664
665    public static ProtobufCubicHermiteSpline parseFrom(final ProtoSource input) throws IOException {
666      return ProtoMessage.mergeFrom(new ProtobufCubicHermiteSpline(), input).checkInitialized();
667    }
668
669    public static ProtobufCubicHermiteSpline parseFrom(final JsonSource input) throws IOException {
670      return ProtoMessage.mergeFrom(new ProtobufCubicHermiteSpline(), input).checkInitialized();
671    }
672
673    /**
674     * @return factory for creating ProtobufCubicHermiteSpline messages
675     */
676    public static MessageFactory<ProtobufCubicHermiteSpline> getFactory() {
677      return ProtobufCubicHermiteSplineFactory.INSTANCE;
678    }
679
680    /**
681     * @return this type's descriptor.
682     */
683    public static Descriptors.Descriptor getDescriptor() {
684      return Spline.wpi_proto_ProtobufCubicHermiteSpline_descriptor;
685    }
686
687    private enum ProtobufCubicHermiteSplineFactory implements MessageFactory<ProtobufCubicHermiteSpline> {
688      INSTANCE;
689
690      @Override
691      public ProtobufCubicHermiteSpline create() {
692        return ProtobufCubicHermiteSpline.newInstance();
693      }
694    }
695
696    /**
697     * Contains name constants used for serializing JSON
698     */
699    static class FieldNames {
700      static final FieldName xInitial = FieldName.forField("xInitial", "x_initial");
701
702      static final FieldName xFinal = FieldName.forField("xFinal", "x_final");
703
704      static final FieldName yInitial = FieldName.forField("yInitial", "y_initial");
705
706      static final FieldName yFinal = FieldName.forField("yFinal", "y_final");
707    }
708  }
709
710  /**
711   * Protobuf type {@code ProtobufQuinticHermiteSpline}
712   */
713  public static final class ProtobufQuinticHermiteSpline extends ProtoMessage<ProtobufQuinticHermiteSpline> implements Cloneable {
714    private static final long serialVersionUID = 0L;
715
716    /**
717     * <code>repeated double x_initial = 1;</code>
718     */
719    private final RepeatedDouble xInitial = RepeatedDouble.newEmptyInstance();
720
721    /**
722     * <code>repeated double x_final = 2;</code>
723     */
724    private final RepeatedDouble xFinal = RepeatedDouble.newEmptyInstance();
725
726    /**
727     * <code>repeated double y_initial = 3;</code>
728     */
729    private final RepeatedDouble yInitial = RepeatedDouble.newEmptyInstance();
730
731    /**
732     * <code>repeated double y_final = 4;</code>
733     */
734    private final RepeatedDouble yFinal = RepeatedDouble.newEmptyInstance();
735
736    private ProtobufQuinticHermiteSpline() {
737    }
738
739    /**
740     * @return a new empty instance of {@code ProtobufQuinticHermiteSpline}
741     */
742    public static ProtobufQuinticHermiteSpline newInstance() {
743      return new ProtobufQuinticHermiteSpline();
744    }
745
746    /**
747     * <code>repeated double x_initial = 1;</code>
748     * @return whether the xInitial field is set
749     */
750    public boolean hasXInitial() {
751      return (bitField0_ & 0x00000001) != 0;
752    }
753
754    /**
755     * <code>repeated double x_initial = 1;</code>
756     * @return this
757     */
758    public ProtobufQuinticHermiteSpline clearXInitial() {
759      bitField0_ &= ~0x00000001;
760      xInitial.clear();
761      return this;
762    }
763
764    /**
765     * <code>repeated double x_initial = 1;</code>
766     *
767     * This method returns the internal storage object without modifying any has state.
768     * The returned object should not be modified and be treated as read-only.
769     *
770     * Use {@link #getMutableXInitial()} if you want to modify it.
771     *
772     * @return internal storage object for reading
773     */
774    public RepeatedDouble getXInitial() {
775      return xInitial;
776    }
777
778    /**
779     * <code>repeated double x_initial = 1;</code>
780     *
781     * This method returns the internal storage object and sets the corresponding
782     * has state. The returned object will become part of this message and its
783     * contents may be modified as long as the has state is not cleared.
784     *
785     * @return internal storage object for modifications
786     */
787    public RepeatedDouble getMutableXInitial() {
788      bitField0_ |= 0x00000001;
789      return xInitial;
790    }
791
792    /**
793     * <code>repeated double x_initial = 1;</code>
794     * @param value the xInitial to add
795     * @return this
796     */
797    public ProtobufQuinticHermiteSpline addXInitial(final double value) {
798      bitField0_ |= 0x00000001;
799      xInitial.add(value);
800      return this;
801    }
802
803    /**
804     * <code>repeated double x_initial = 1;</code>
805     * @param values the xInitial to add
806     * @return this
807     */
808    public ProtobufQuinticHermiteSpline addAllXInitial(final double... values) {
809      bitField0_ |= 0x00000001;
810      xInitial.addAll(values);
811      return this;
812    }
813
814    /**
815     * <code>repeated double x_final = 2;</code>
816     * @return whether the xFinal field is set
817     */
818    public boolean hasXFinal() {
819      return (bitField0_ & 0x00000002) != 0;
820    }
821
822    /**
823     * <code>repeated double x_final = 2;</code>
824     * @return this
825     */
826    public ProtobufQuinticHermiteSpline clearXFinal() {
827      bitField0_ &= ~0x00000002;
828      xFinal.clear();
829      return this;
830    }
831
832    /**
833     * <code>repeated double x_final = 2;</code>
834     *
835     * This method returns the internal storage object without modifying any has state.
836     * The returned object should not be modified and be treated as read-only.
837     *
838     * Use {@link #getMutableXFinal()} if you want to modify it.
839     *
840     * @return internal storage object for reading
841     */
842    public RepeatedDouble getXFinal() {
843      return xFinal;
844    }
845
846    /**
847     * <code>repeated double x_final = 2;</code>
848     *
849     * This method returns the internal storage object and sets the corresponding
850     * has state. The returned object will become part of this message and its
851     * contents may be modified as long as the has state is not cleared.
852     *
853     * @return internal storage object for modifications
854     */
855    public RepeatedDouble getMutableXFinal() {
856      bitField0_ |= 0x00000002;
857      return xFinal;
858    }
859
860    /**
861     * <code>repeated double x_final = 2;</code>
862     * @param value the xFinal to add
863     * @return this
864     */
865    public ProtobufQuinticHermiteSpline addXFinal(final double value) {
866      bitField0_ |= 0x00000002;
867      xFinal.add(value);
868      return this;
869    }
870
871    /**
872     * <code>repeated double x_final = 2;</code>
873     * @param values the xFinal to add
874     * @return this
875     */
876    public ProtobufQuinticHermiteSpline addAllXFinal(final double... values) {
877      bitField0_ |= 0x00000002;
878      xFinal.addAll(values);
879      return this;
880    }
881
882    /**
883     * <code>repeated double y_initial = 3;</code>
884     * @return whether the yInitial field is set
885     */
886    public boolean hasYInitial() {
887      return (bitField0_ & 0x00000004) != 0;
888    }
889
890    /**
891     * <code>repeated double y_initial = 3;</code>
892     * @return this
893     */
894    public ProtobufQuinticHermiteSpline clearYInitial() {
895      bitField0_ &= ~0x00000004;
896      yInitial.clear();
897      return this;
898    }
899
900    /**
901     * <code>repeated double y_initial = 3;</code>
902     *
903     * This method returns the internal storage object without modifying any has state.
904     * The returned object should not be modified and be treated as read-only.
905     *
906     * Use {@link #getMutableYInitial()} if you want to modify it.
907     *
908     * @return internal storage object for reading
909     */
910    public RepeatedDouble getYInitial() {
911      return yInitial;
912    }
913
914    /**
915     * <code>repeated double y_initial = 3;</code>
916     *
917     * This method returns the internal storage object and sets the corresponding
918     * has state. The returned object will become part of this message and its
919     * contents may be modified as long as the has state is not cleared.
920     *
921     * @return internal storage object for modifications
922     */
923    public RepeatedDouble getMutableYInitial() {
924      bitField0_ |= 0x00000004;
925      return yInitial;
926    }
927
928    /**
929     * <code>repeated double y_initial = 3;</code>
930     * @param value the yInitial to add
931     * @return this
932     */
933    public ProtobufQuinticHermiteSpline addYInitial(final double value) {
934      bitField0_ |= 0x00000004;
935      yInitial.add(value);
936      return this;
937    }
938
939    /**
940     * <code>repeated double y_initial = 3;</code>
941     * @param values the yInitial to add
942     * @return this
943     */
944    public ProtobufQuinticHermiteSpline addAllYInitial(final double... values) {
945      bitField0_ |= 0x00000004;
946      yInitial.addAll(values);
947      return this;
948    }
949
950    /**
951     * <code>repeated double y_final = 4;</code>
952     * @return whether the yFinal field is set
953     */
954    public boolean hasYFinal() {
955      return (bitField0_ & 0x00000008) != 0;
956    }
957
958    /**
959     * <code>repeated double y_final = 4;</code>
960     * @return this
961     */
962    public ProtobufQuinticHermiteSpline clearYFinal() {
963      bitField0_ &= ~0x00000008;
964      yFinal.clear();
965      return this;
966    }
967
968    /**
969     * <code>repeated double y_final = 4;</code>
970     *
971     * This method returns the internal storage object without modifying any has state.
972     * The returned object should not be modified and be treated as read-only.
973     *
974     * Use {@link #getMutableYFinal()} if you want to modify it.
975     *
976     * @return internal storage object for reading
977     */
978    public RepeatedDouble getYFinal() {
979      return yFinal;
980    }
981
982    /**
983     * <code>repeated double y_final = 4;</code>
984     *
985     * This method returns the internal storage object and sets the corresponding
986     * has state. The returned object will become part of this message and its
987     * contents may be modified as long as the has state is not cleared.
988     *
989     * @return internal storage object for modifications
990     */
991    public RepeatedDouble getMutableYFinal() {
992      bitField0_ |= 0x00000008;
993      return yFinal;
994    }
995
996    /**
997     * <code>repeated double y_final = 4;</code>
998     * @param value the yFinal to add
999     * @return this
1000     */
1001    public ProtobufQuinticHermiteSpline addYFinal(final double value) {
1002      bitField0_ |= 0x00000008;
1003      yFinal.add(value);
1004      return this;
1005    }
1006
1007    /**
1008     * <code>repeated double y_final = 4;</code>
1009     * @param values the yFinal to add
1010     * @return this
1011     */
1012    public ProtobufQuinticHermiteSpline addAllYFinal(final double... values) {
1013      bitField0_ |= 0x00000008;
1014      yFinal.addAll(values);
1015      return this;
1016    }
1017
1018    @Override
1019    public ProtobufQuinticHermiteSpline copyFrom(final ProtobufQuinticHermiteSpline other) {
1020      cachedSize = other.cachedSize;
1021      if ((bitField0_ | other.bitField0_) != 0) {
1022        bitField0_ = other.bitField0_;
1023        xInitial.copyFrom(other.xInitial);
1024        xFinal.copyFrom(other.xFinal);
1025        yInitial.copyFrom(other.yInitial);
1026        yFinal.copyFrom(other.yFinal);
1027      }
1028      return this;
1029    }
1030
1031    @Override
1032    public ProtobufQuinticHermiteSpline mergeFrom(final ProtobufQuinticHermiteSpline other) {
1033      if (other.isEmpty()) {
1034        return this;
1035      }
1036      cachedSize = -1;
1037      if (other.hasXInitial()) {
1038        getMutableXInitial().addAll(other.xInitial);
1039      }
1040      if (other.hasXFinal()) {
1041        getMutableXFinal().addAll(other.xFinal);
1042      }
1043      if (other.hasYInitial()) {
1044        getMutableYInitial().addAll(other.yInitial);
1045      }
1046      if (other.hasYFinal()) {
1047        getMutableYFinal().addAll(other.yFinal);
1048      }
1049      return this;
1050    }
1051
1052    @Override
1053    public ProtobufQuinticHermiteSpline clear() {
1054      if (isEmpty()) {
1055        return this;
1056      }
1057      cachedSize = -1;
1058      bitField0_ = 0;
1059      xInitial.clear();
1060      xFinal.clear();
1061      yInitial.clear();
1062      yFinal.clear();
1063      return this;
1064    }
1065
1066    @Override
1067    public ProtobufQuinticHermiteSpline clearQuick() {
1068      if (isEmpty()) {
1069        return this;
1070      }
1071      cachedSize = -1;
1072      bitField0_ = 0;
1073      xInitial.clear();
1074      xFinal.clear();
1075      yInitial.clear();
1076      yFinal.clear();
1077      return this;
1078    }
1079
1080    @Override
1081    public boolean equals(Object o) {
1082      if (o == this) {
1083        return true;
1084      }
1085      if (!(o instanceof ProtobufQuinticHermiteSpline)) {
1086        return false;
1087      }
1088      ProtobufQuinticHermiteSpline other = (ProtobufQuinticHermiteSpline) o;
1089      return bitField0_ == other.bitField0_
1090        && (!hasXInitial() || xInitial.equals(other.xInitial))
1091        && (!hasXFinal() || xFinal.equals(other.xFinal))
1092        && (!hasYInitial() || yInitial.equals(other.yInitial))
1093        && (!hasYFinal() || yFinal.equals(other.yFinal));
1094    }
1095
1096    @Override
1097    public void writeTo(final ProtoSink output) throws IOException {
1098      if ((bitField0_ & 0x00000001) != 0) {
1099        for (int i = 0; i < xInitial.length(); i++) {
1100          output.writeRawByte((byte) 9);
1101          output.writeDoubleNoTag(xInitial.array()[i]);
1102        }
1103      }
1104      if ((bitField0_ & 0x00000002) != 0) {
1105        for (int i = 0; i < xFinal.length(); i++) {
1106          output.writeRawByte((byte) 17);
1107          output.writeDoubleNoTag(xFinal.array()[i]);
1108        }
1109      }
1110      if ((bitField0_ & 0x00000004) != 0) {
1111        for (int i = 0; i < yInitial.length(); i++) {
1112          output.writeRawByte((byte) 25);
1113          output.writeDoubleNoTag(yInitial.array()[i]);
1114        }
1115      }
1116      if ((bitField0_ & 0x00000008) != 0) {
1117        for (int i = 0; i < yFinal.length(); i++) {
1118          output.writeRawByte((byte) 33);
1119          output.writeDoubleNoTag(yFinal.array()[i]);
1120        }
1121      }
1122    }
1123
1124    @Override
1125    protected int computeSerializedSize() {
1126      int size = 0;
1127      if ((bitField0_ & 0x00000001) != 0) {
1128        size += (1 + 8) * xInitial.length();
1129      }
1130      if ((bitField0_ & 0x00000002) != 0) {
1131        size += (1 + 8) * xFinal.length();
1132      }
1133      if ((bitField0_ & 0x00000004) != 0) {
1134        size += (1 + 8) * yInitial.length();
1135      }
1136      if ((bitField0_ & 0x00000008) != 0) {
1137        size += (1 + 8) * yFinal.length();
1138      }
1139      return size;
1140    }
1141
1142    @Override
1143    @SuppressWarnings("fallthrough")
1144    public ProtobufQuinticHermiteSpline mergeFrom(final ProtoSource input) throws IOException {
1145      // Enabled Fall-Through Optimization (QuickBuffers)
1146      int tag = input.readTag();
1147      while (true) {
1148        switch (tag) {
1149          case 10: {
1150            // xInitial [packed=true]
1151            input.readPackedDouble(xInitial);
1152            bitField0_ |= 0x00000001;
1153            tag = input.readTag();
1154            if (tag != 18) {
1155              break;
1156            }
1157          }
1158          case 18: {
1159            // xFinal [packed=true]
1160            input.readPackedDouble(xFinal);
1161            bitField0_ |= 0x00000002;
1162            tag = input.readTag();
1163            if (tag != 26) {
1164              break;
1165            }
1166          }
1167          case 26: {
1168            // yInitial [packed=true]
1169            input.readPackedDouble(yInitial);
1170            bitField0_ |= 0x00000004;
1171            tag = input.readTag();
1172            if (tag != 34) {
1173              break;
1174            }
1175          }
1176          case 34: {
1177            // yFinal [packed=true]
1178            input.readPackedDouble(yFinal);
1179            bitField0_ |= 0x00000008;
1180            tag = input.readTag();
1181            if (tag != 0) {
1182              break;
1183            }
1184          }
1185          case 0: {
1186            return this;
1187          }
1188          default: {
1189            if (!input.skipField(tag)) {
1190              return this;
1191            }
1192            tag = input.readTag();
1193            break;
1194          }
1195          case 9: {
1196            // xInitial [packed=false]
1197            tag = input.readRepeatedDouble(xInitial, tag);
1198            bitField0_ |= 0x00000001;
1199            break;
1200          }
1201          case 17: {
1202            // xFinal [packed=false]
1203            tag = input.readRepeatedDouble(xFinal, tag);
1204            bitField0_ |= 0x00000002;
1205            break;
1206          }
1207          case 25: {
1208            // yInitial [packed=false]
1209            tag = input.readRepeatedDouble(yInitial, tag);
1210            bitField0_ |= 0x00000004;
1211            break;
1212          }
1213          case 33: {
1214            // yFinal [packed=false]
1215            tag = input.readRepeatedDouble(yFinal, tag);
1216            bitField0_ |= 0x00000008;
1217            break;
1218          }
1219        }
1220      }
1221    }
1222
1223    @Override
1224    public void writeTo(final JsonSink output) throws IOException {
1225      output.beginObject();
1226      if ((bitField0_ & 0x00000001) != 0) {
1227        output.writeRepeatedDouble(FieldNames.xInitial, xInitial);
1228      }
1229      if ((bitField0_ & 0x00000002) != 0) {
1230        output.writeRepeatedDouble(FieldNames.xFinal, xFinal);
1231      }
1232      if ((bitField0_ & 0x00000004) != 0) {
1233        output.writeRepeatedDouble(FieldNames.yInitial, yInitial);
1234      }
1235      if ((bitField0_ & 0x00000008) != 0) {
1236        output.writeRepeatedDouble(FieldNames.yFinal, yFinal);
1237      }
1238      output.endObject();
1239    }
1240
1241    @Override
1242    public ProtobufQuinticHermiteSpline mergeFrom(final JsonSource input) throws IOException {
1243      if (!input.beginObject()) {
1244        return this;
1245      }
1246      while (!input.isAtEnd()) {
1247        switch (input.readFieldHash()) {
1248          case -1998129236:
1249          case -2134571395: {
1250            if (input.isAtField(FieldNames.xInitial)) {
1251              if (!input.trySkipNullValue()) {
1252                input.readRepeatedDouble(xInitial);
1253                bitField0_ |= 0x00000001;
1254              }
1255            } else {
1256              input.skipUnknownField();
1257            }
1258            break;
1259          }
1260          case -791585826:
1261          case 1943464687: {
1262            if (input.isAtField(FieldNames.xFinal)) {
1263              if (!input.trySkipNullValue()) {
1264                input.readRepeatedDouble(xFinal);
1265                bitField0_ |= 0x00000002;
1266              }
1267            } else {
1268              input.skipUnknownField();
1269            }
1270            break;
1271          }
1272          case -255318901:
1273          case 352941438: {
1274            if (input.isAtField(FieldNames.yInitial)) {
1275              if (!input.trySkipNullValue()) {
1276                input.readRepeatedDouble(yInitial);
1277                bitField0_ |= 0x00000004;
1278              }
1279            } else {
1280              input.skipUnknownField();
1281            }
1282            break;
1283          }
1284          case -762956675:
1285          case -1463998928: {
1286            if (input.isAtField(FieldNames.yFinal)) {
1287              if (!input.trySkipNullValue()) {
1288                input.readRepeatedDouble(yFinal);
1289                bitField0_ |= 0x00000008;
1290              }
1291            } else {
1292              input.skipUnknownField();
1293            }
1294            break;
1295          }
1296          default: {
1297            input.skipUnknownField();
1298            break;
1299          }
1300        }
1301      }
1302      input.endObject();
1303      return this;
1304    }
1305
1306    @Override
1307    public ProtobufQuinticHermiteSpline clone() {
1308      return new ProtobufQuinticHermiteSpline().copyFrom(this);
1309    }
1310
1311    @Override
1312    public boolean isEmpty() {
1313      return ((bitField0_) == 0);
1314    }
1315
1316    public static ProtobufQuinticHermiteSpline parseFrom(final byte[] data) throws
1317        InvalidProtocolBufferException {
1318      return ProtoMessage.mergeFrom(new ProtobufQuinticHermiteSpline(), data).checkInitialized();
1319    }
1320
1321    public static ProtobufQuinticHermiteSpline parseFrom(final ProtoSource input) throws
1322        IOException {
1323      return ProtoMessage.mergeFrom(new ProtobufQuinticHermiteSpline(), input).checkInitialized();
1324    }
1325
1326    public static ProtobufQuinticHermiteSpline parseFrom(final JsonSource input) throws
1327        IOException {
1328      return ProtoMessage.mergeFrom(new ProtobufQuinticHermiteSpline(), input).checkInitialized();
1329    }
1330
1331    /**
1332     * @return factory for creating ProtobufQuinticHermiteSpline messages
1333     */
1334    public static MessageFactory<ProtobufQuinticHermiteSpline> getFactory() {
1335      return ProtobufQuinticHermiteSplineFactory.INSTANCE;
1336    }
1337
1338    /**
1339     * @return this type's descriptor.
1340     */
1341    public static Descriptors.Descriptor getDescriptor() {
1342      return Spline.wpi_proto_ProtobufQuinticHermiteSpline_descriptor;
1343    }
1344
1345    private enum ProtobufQuinticHermiteSplineFactory implements MessageFactory<ProtobufQuinticHermiteSpline> {
1346      INSTANCE;
1347
1348      @Override
1349      public ProtobufQuinticHermiteSpline create() {
1350        return ProtobufQuinticHermiteSpline.newInstance();
1351      }
1352    }
1353
1354    /**
1355     * Contains name constants used for serializing JSON
1356     */
1357    static class FieldNames {
1358      static final FieldName xInitial = FieldName.forField("xInitial", "x_initial");
1359
1360      static final FieldName xFinal = FieldName.forField("xFinal", "x_final");
1361
1362      static final FieldName yInitial = FieldName.forField("yInitial", "y_initial");
1363
1364      static final FieldName yFinal = FieldName.forField("yFinal", "y_final");
1365    }
1366  }
1367}