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(1256, 022 "ChBnZW9tZXRyeTJkLnByb3RvEgl3cGkucHJvdG8iMwoVUHJvdG9idWZUcmFuc2xhdGlvbjJkEgwKAXgY" + 023 "ASABKAFSAXgSDAoBeRgCIAEoAVIBeSIqChJQcm90b2J1ZlJvdGF0aW9uMmQSFAoFdmFsdWUYASABKAFS" + 024 "BXZhbHVlIo8BCg5Qcm90b2J1ZlBvc2UyZBJCCgt0cmFuc2xhdGlvbhgBIAEoCzIgLndwaS5wcm90by5Q" + 025 "cm90b2J1ZlRyYW5zbGF0aW9uMmRSC3RyYW5zbGF0aW9uEjkKCHJvdGF0aW9uGAIgASgLMh0ud3BpLnBy" + 026 "b3RvLlByb3RvYnVmUm90YXRpb24yZFIIcm90YXRpb24ilAEKE1Byb3RvYnVmVHJhbnNmb3JtMmQSQgoL" + 027 "dHJhbnNsYXRpb24YASABKAsyIC53cGkucHJvdG8uUHJvdG9idWZUcmFuc2xhdGlvbjJkUgt0cmFuc2xh" + 028 "dGlvbhI5Cghyb3RhdGlvbhgCIAEoCzIdLndwaS5wcm90by5Qcm90b2J1ZlJvdGF0aW9uMmRSCHJvdGF0" + 029 "aW9uIkkKD1Byb3RvYnVmVHdpc3QyZBIOCgJkeBgBIAEoAVICZHgSDgoCZHkYAiABKAFSAmR5EhYKBmR0" + 030 "aGV0YRgDIAEoAVIGZHRoZXRhQhoKGGVkdS53cGkuZmlyc3QubWF0aC5wcm90b0rPBQoGEgQAAB0BCggK" + 031 "AQwSAwAAEgoICgECEgMCABIKCAoBCBIDBAAxCgkKAggBEgMEADEKCgoCBAASBAYACQEKCgoDBAABEgMG" + 032 "CB0KCwoEBAACABIDBwIPCgwKBQQAAgAFEgMHAggKDAoFBAACAAESAwcJCgoMCgUEAAIAAxIDBw0OCgsK" + 033 "BAQAAgESAwgCDwoMCgUEAAIBBRIDCAIICgwKBQQAAgEBEgMICQoKDAoFBAACAQMSAwgNDgoKCgIEARIE" + 034 "CwANAQoKCgMEAQESAwsIGgoLCgQEAQIAEgMMAhMKDAoFBAECAAUSAwwCCAoMCgUEAQIAARIDDAkOCgwK" + 035 "BQQBAgADEgMMERIKCgoCBAISBA8AEgEKCgoDBAIBEgMPCBYKCwoEBAICABIDEAIoCgwKBQQCAgAGEgMQ" + 036 "AhcKDAoFBAICAAESAxAYIwoMCgUEAgIAAxIDECYnCgsKBAQCAgESAxECIgoMCgUEAgIBBhIDEQIUCgwK" + 037 "BQQCAgEBEgMRFR0KDAoFBAICAQMSAxEgIQoKCgIEAxIEFAAXAQoKCgMEAwESAxQIGwoLCgQEAwIAEgMV" + 038 "AigKDAoFBAMCAAYSAxUCFwoMCgUEAwIAARIDFRgjCgwKBQQDAgADEgMVJicKCwoEBAMCARIDFgIiCgwK" + 039 "BQQDAgEGEgMWAhQKDAoFBAMCAQESAxYVHQoMCgUEAwIBAxIDFiAhCgoKAgQEEgQZAB0BCgoKAwQEARID" + 040 "GQgXCgsKBAQEAgASAxoCEAoMCgUEBAIABRIDGgIICgwKBQQEAgABEgMaCQsKDAoFBAQCAAMSAxoODwoL" + 041 "CgQEBAIBEgMbAhAKDAoFBAQCAQUSAxsCCAoMCgUEBAIBARIDGwkLCgwKBQQEAgEDEgMbDg8KCwoEBAQC", 042 "AhIDHAIUCgwKBQQEAgIFEgMcAggKDAoFBAQCAgESAxwJDwoMCgUEBAICAxIDHBITYgZwcm90bzM="); 043 044 static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("geometry2d.proto", "wpi.proto", descriptorData); 045 046 static final Descriptors.Descriptor wpi_proto_ProtobufTranslation2d_descriptor = descriptor.internalContainedType(31, 51, "ProtobufTranslation2d", "wpi.proto.ProtobufTranslation2d"); 047 048 static final Descriptors.Descriptor wpi_proto_ProtobufRotation2d_descriptor = descriptor.internalContainedType(84, 42, "ProtobufRotation2d", "wpi.proto.ProtobufRotation2d"); 049 050 static final Descriptors.Descriptor wpi_proto_ProtobufPose2d_descriptor = descriptor.internalContainedType(129, 143, "ProtobufPose2d", "wpi.proto.ProtobufPose2d"); 051 052 static final Descriptors.Descriptor wpi_proto_ProtobufTransform2d_descriptor = descriptor.internalContainedType(275, 148, "ProtobufTransform2d", "wpi.proto.ProtobufTransform2d"); 053 054 static final Descriptors.Descriptor wpi_proto_ProtobufTwist2d_descriptor = descriptor.internalContainedType(425, 73, "ProtobufTwist2d", "wpi.proto.ProtobufTwist2d"); 055 056 /** 057 * @return this proto file's descriptor. 058 */ 059 public static Descriptors.FileDescriptor getDescriptor() { 060 return descriptor; 061 } 062 063 /** 064 * Protobuf type {@code ProtobufTranslation2d} 065 */ 066 public static final class ProtobufTranslation2d extends ProtoMessage<ProtobufTranslation2d> implements Cloneable { 067 private static final long serialVersionUID = 0L; 068 069 /** 070 * <code>optional double x = 1;</code> 071 */ 072 private double x; 073 074 /** 075 * <code>optional double y = 2;</code> 076 */ 077 private double y; 078 079 private ProtobufTranslation2d() { 080 } 081 082 /** 083 * @return a new empty instance of {@code ProtobufTranslation2d} 084 */ 085 public static ProtobufTranslation2d newInstance() { 086 return new ProtobufTranslation2d(); 087 } 088 089 /** 090 * <code>optional double x = 1;</code> 091 * @return whether the x field is set 092 */ 093 public boolean hasX() { 094 return (bitField0_ & 0x00000001) != 0; 095 } 096 097 /** 098 * <code>optional double x = 1;</code> 099 * @return this 100 */ 101 public ProtobufTranslation2d clearX() { 102 bitField0_ &= ~0x00000001; 103 x = 0D; 104 return this; 105 } 106 107 /** 108 * <code>optional double x = 1;</code> 109 * @return the x 110 */ 111 public double getX() { 112 return x; 113 } 114 115 /** 116 * <code>optional double x = 1;</code> 117 * @param value the x to set 118 * @return this 119 */ 120 public ProtobufTranslation2d setX(final double value) { 121 bitField0_ |= 0x00000001; 122 x = value; 123 return this; 124 } 125 126 /** 127 * <code>optional double y = 2;</code> 128 * @return whether the y field is set 129 */ 130 public boolean hasY() { 131 return (bitField0_ & 0x00000002) != 0; 132 } 133 134 /** 135 * <code>optional double y = 2;</code> 136 * @return this 137 */ 138 public ProtobufTranslation2d clearY() { 139 bitField0_ &= ~0x00000002; 140 y = 0D; 141 return this; 142 } 143 144 /** 145 * <code>optional double y = 2;</code> 146 * @return the y 147 */ 148 public double getY() { 149 return y; 150 } 151 152 /** 153 * <code>optional double y = 2;</code> 154 * @param value the y to set 155 * @return this 156 */ 157 public ProtobufTranslation2d setY(final double value) { 158 bitField0_ |= 0x00000002; 159 y = value; 160 return this; 161 } 162 163 @Override 164 public ProtobufTranslation2d copyFrom(final ProtobufTranslation2d other) { 165 cachedSize = other.cachedSize; 166 if ((bitField0_ | other.bitField0_) != 0) { 167 bitField0_ = other.bitField0_; 168 x = other.x; 169 y = other.y; 170 } 171 return this; 172 } 173 174 @Override 175 public ProtobufTranslation2d mergeFrom(final ProtobufTranslation2d other) { 176 if (other.isEmpty()) { 177 return this; 178 } 179 cachedSize = -1; 180 if (other.hasX()) { 181 setX(other.x); 182 } 183 if (other.hasY()) { 184 setY(other.y); 185 } 186 return this; 187 } 188 189 @Override 190 public ProtobufTranslation2d clear() { 191 if (isEmpty()) { 192 return this; 193 } 194 cachedSize = -1; 195 bitField0_ = 0; 196 x = 0D; 197 y = 0D; 198 return this; 199 } 200 201 @Override 202 public ProtobufTranslation2d clearQuick() { 203 if (isEmpty()) { 204 return this; 205 } 206 cachedSize = -1; 207 bitField0_ = 0; 208 return this; 209 } 210 211 @Override 212 public boolean equals(Object o) { 213 if (o == this) { 214 return true; 215 } 216 if (!(o instanceof ProtobufTranslation2d)) { 217 return false; 218 } 219 ProtobufTranslation2d other = (ProtobufTranslation2d) o; 220 return bitField0_ == other.bitField0_ 221 && (!hasX() || ProtoUtil.isEqual(x, other.x)) 222 && (!hasY() || ProtoUtil.isEqual(y, other.y)); 223 } 224 225 @Override 226 public void writeTo(final ProtoSink output) throws IOException { 227 if ((bitField0_ & 0x00000001) != 0) { 228 output.writeRawByte((byte) 9); 229 output.writeDoubleNoTag(x); 230 } 231 if ((bitField0_ & 0x00000002) != 0) { 232 output.writeRawByte((byte) 17); 233 output.writeDoubleNoTag(y); 234 } 235 } 236 237 @Override 238 protected int computeSerializedSize() { 239 int size = 0; 240 if ((bitField0_ & 0x00000001) != 0) { 241 size += 9; 242 } 243 if ((bitField0_ & 0x00000002) != 0) { 244 size += 9; 245 } 246 return size; 247 } 248 249 @Override 250 @SuppressWarnings("fallthrough") 251 public ProtobufTranslation2d mergeFrom(final ProtoSource input) throws IOException { 252 // Enabled Fall-Through Optimization (QuickBuffers) 253 int tag = input.readTag(); 254 while (true) { 255 switch (tag) { 256 case 9: { 257 // x 258 x = input.readDouble(); 259 bitField0_ |= 0x00000001; 260 tag = input.readTag(); 261 if (tag != 17) { 262 break; 263 } 264 } 265 case 17: { 266 // y 267 y = input.readDouble(); 268 bitField0_ |= 0x00000002; 269 tag = input.readTag(); 270 if (tag != 0) { 271 break; 272 } 273 } 274 case 0: { 275 return this; 276 } 277 default: { 278 if (!input.skipField(tag)) { 279 return this; 280 } 281 tag = input.readTag(); 282 break; 283 } 284 } 285 } 286 } 287 288 @Override 289 public void writeTo(final JsonSink output) throws IOException { 290 output.beginObject(); 291 if ((bitField0_ & 0x00000001) != 0) { 292 output.writeDouble(FieldNames.x, x); 293 } 294 if ((bitField0_ & 0x00000002) != 0) { 295 output.writeDouble(FieldNames.y, y); 296 } 297 output.endObject(); 298 } 299 300 @Override 301 public ProtobufTranslation2d mergeFrom(final JsonSource input) throws IOException { 302 if (!input.beginObject()) { 303 return this; 304 } 305 while (!input.isAtEnd()) { 306 switch (input.readFieldHash()) { 307 case 120: { 308 if (input.isAtField(FieldNames.x)) { 309 if (!input.trySkipNullValue()) { 310 x = input.readDouble(); 311 bitField0_ |= 0x00000001; 312 } 313 } else { 314 input.skipUnknownField(); 315 } 316 break; 317 } 318 case 121: { 319 if (input.isAtField(FieldNames.y)) { 320 if (!input.trySkipNullValue()) { 321 y = input.readDouble(); 322 bitField0_ |= 0x00000002; 323 } 324 } else { 325 input.skipUnknownField(); 326 } 327 break; 328 } 329 default: { 330 input.skipUnknownField(); 331 break; 332 } 333 } 334 } 335 input.endObject(); 336 return this; 337 } 338 339 @Override 340 public ProtobufTranslation2d clone() { 341 return new ProtobufTranslation2d().copyFrom(this); 342 } 343 344 @Override 345 public boolean isEmpty() { 346 return ((bitField0_) == 0); 347 } 348 349 public static ProtobufTranslation2d parseFrom(final byte[] data) throws 350 InvalidProtocolBufferException { 351 return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), data).checkInitialized(); 352 } 353 354 public static ProtobufTranslation2d parseFrom(final ProtoSource input) throws IOException { 355 return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), input).checkInitialized(); 356 } 357 358 public static ProtobufTranslation2d parseFrom(final JsonSource input) throws IOException { 359 return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), input).checkInitialized(); 360 } 361 362 /** 363 * @return factory for creating ProtobufTranslation2d messages 364 */ 365 public static MessageFactory<ProtobufTranslation2d> getFactory() { 366 return ProtobufTranslation2dFactory.INSTANCE; 367 } 368 369 /** 370 * @return this type's descriptor. 371 */ 372 public static Descriptors.Descriptor getDescriptor() { 373 return Geometry2D.wpi_proto_ProtobufTranslation2d_descriptor; 374 } 375 376 private enum ProtobufTranslation2dFactory implements MessageFactory<ProtobufTranslation2d> { 377 INSTANCE; 378 379 @Override 380 public ProtobufTranslation2d create() { 381 return ProtobufTranslation2d.newInstance(); 382 } 383 } 384 385 /** 386 * Contains name constants used for serializing JSON 387 */ 388 static class FieldNames { 389 static final FieldName x = FieldName.forField("x"); 390 391 static final FieldName y = FieldName.forField("y"); 392 } 393 } 394 395 /** 396 * Protobuf type {@code ProtobufRotation2d} 397 */ 398 public static final class ProtobufRotation2d extends ProtoMessage<ProtobufRotation2d> implements Cloneable { 399 private static final long serialVersionUID = 0L; 400 401 /** 402 * <code>optional double value = 1;</code> 403 */ 404 private double value_; 405 406 private ProtobufRotation2d() { 407 } 408 409 /** 410 * @return a new empty instance of {@code ProtobufRotation2d} 411 */ 412 public static ProtobufRotation2d newInstance() { 413 return new ProtobufRotation2d(); 414 } 415 416 /** 417 * <code>optional double value = 1;</code> 418 * @return whether the value_ field is set 419 */ 420 public boolean hasValue() { 421 return (bitField0_ & 0x00000001) != 0; 422 } 423 424 /** 425 * <code>optional double value = 1;</code> 426 * @return this 427 */ 428 public ProtobufRotation2d clearValue() { 429 bitField0_ &= ~0x00000001; 430 value_ = 0D; 431 return this; 432 } 433 434 /** 435 * <code>optional double value = 1;</code> 436 * @return the value_ 437 */ 438 public double getValue() { 439 return value_; 440 } 441 442 /** 443 * <code>optional double value = 1;</code> 444 * @param value the value_ to set 445 * @return this 446 */ 447 public ProtobufRotation2d setValue(final double value) { 448 bitField0_ |= 0x00000001; 449 value_ = value; 450 return this; 451 } 452 453 @Override 454 public ProtobufRotation2d copyFrom(final ProtobufRotation2d other) { 455 cachedSize = other.cachedSize; 456 if ((bitField0_ | other.bitField0_) != 0) { 457 bitField0_ = other.bitField0_; 458 value_ = other.value_; 459 } 460 return this; 461 } 462 463 @Override 464 public ProtobufRotation2d mergeFrom(final ProtobufRotation2d other) { 465 if (other.isEmpty()) { 466 return this; 467 } 468 cachedSize = -1; 469 if (other.hasValue()) { 470 setValue(other.value_); 471 } 472 return this; 473 } 474 475 @Override 476 public ProtobufRotation2d clear() { 477 if (isEmpty()) { 478 return this; 479 } 480 cachedSize = -1; 481 bitField0_ = 0; 482 value_ = 0D; 483 return this; 484 } 485 486 @Override 487 public ProtobufRotation2d clearQuick() { 488 if (isEmpty()) { 489 return this; 490 } 491 cachedSize = -1; 492 bitField0_ = 0; 493 return this; 494 } 495 496 @Override 497 public boolean equals(Object o) { 498 if (o == this) { 499 return true; 500 } 501 if (!(o instanceof ProtobufRotation2d)) { 502 return false; 503 } 504 ProtobufRotation2d other = (ProtobufRotation2d) o; 505 return bitField0_ == other.bitField0_ 506 && (!hasValue() || ProtoUtil.isEqual(value_, other.value_)); 507 } 508 509 @Override 510 public void writeTo(final ProtoSink output) throws IOException { 511 if ((bitField0_ & 0x00000001) != 0) { 512 output.writeRawByte((byte) 9); 513 output.writeDoubleNoTag(value_); 514 } 515 } 516 517 @Override 518 protected int computeSerializedSize() { 519 int size = 0; 520 if ((bitField0_ & 0x00000001) != 0) { 521 size += 9; 522 } 523 return size; 524 } 525 526 @Override 527 @SuppressWarnings("fallthrough") 528 public ProtobufRotation2d mergeFrom(final ProtoSource input) throws IOException { 529 // Enabled Fall-Through Optimization (QuickBuffers) 530 int tag = input.readTag(); 531 while (true) { 532 switch (tag) { 533 case 9: { 534 // value_ 535 value_ = input.readDouble(); 536 bitField0_ |= 0x00000001; 537 tag = input.readTag(); 538 if (tag != 0) { 539 break; 540 } 541 } 542 case 0: { 543 return this; 544 } 545 default: { 546 if (!input.skipField(tag)) { 547 return this; 548 } 549 tag = input.readTag(); 550 break; 551 } 552 } 553 } 554 } 555 556 @Override 557 public void writeTo(final JsonSink output) throws IOException { 558 output.beginObject(); 559 if ((bitField0_ & 0x00000001) != 0) { 560 output.writeDouble(FieldNames.value_, value_); 561 } 562 output.endObject(); 563 } 564 565 @Override 566 public ProtobufRotation2d mergeFrom(final JsonSource input) throws IOException { 567 if (!input.beginObject()) { 568 return this; 569 } 570 while (!input.isAtEnd()) { 571 switch (input.readFieldHash()) { 572 case 111972721: { 573 if (input.isAtField(FieldNames.value_)) { 574 if (!input.trySkipNullValue()) { 575 value_ = input.readDouble(); 576 bitField0_ |= 0x00000001; 577 } 578 } else { 579 input.skipUnknownField(); 580 } 581 break; 582 } 583 default: { 584 input.skipUnknownField(); 585 break; 586 } 587 } 588 } 589 input.endObject(); 590 return this; 591 } 592 593 @Override 594 public ProtobufRotation2d clone() { 595 return new ProtobufRotation2d().copyFrom(this); 596 } 597 598 @Override 599 public boolean isEmpty() { 600 return ((bitField0_) == 0); 601 } 602 603 public static ProtobufRotation2d parseFrom(final byte[] data) throws 604 InvalidProtocolBufferException { 605 return ProtoMessage.mergeFrom(new ProtobufRotation2d(), data).checkInitialized(); 606 } 607 608 public static ProtobufRotation2d parseFrom(final ProtoSource input) throws IOException { 609 return ProtoMessage.mergeFrom(new ProtobufRotation2d(), input).checkInitialized(); 610 } 611 612 public static ProtobufRotation2d parseFrom(final JsonSource input) throws IOException { 613 return ProtoMessage.mergeFrom(new ProtobufRotation2d(), input).checkInitialized(); 614 } 615 616 /** 617 * @return factory for creating ProtobufRotation2d messages 618 */ 619 public static MessageFactory<ProtobufRotation2d> getFactory() { 620 return ProtobufRotation2dFactory.INSTANCE; 621 } 622 623 /** 624 * @return this type's descriptor. 625 */ 626 public static Descriptors.Descriptor getDescriptor() { 627 return Geometry2D.wpi_proto_ProtobufRotation2d_descriptor; 628 } 629 630 private enum ProtobufRotation2dFactory implements MessageFactory<ProtobufRotation2d> { 631 INSTANCE; 632 633 @Override 634 public ProtobufRotation2d create() { 635 return ProtobufRotation2d.newInstance(); 636 } 637 } 638 639 /** 640 * Contains name constants used for serializing JSON 641 */ 642 static class FieldNames { 643 static final FieldName value_ = FieldName.forField("value"); 644 } 645 } 646 647 /** 648 * Protobuf type {@code ProtobufPose2d} 649 */ 650 public static final class ProtobufPose2d extends ProtoMessage<ProtobufPose2d> implements Cloneable { 651 private static final long serialVersionUID = 0L; 652 653 /** 654 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 655 */ 656 private final ProtobufTranslation2d translation = ProtobufTranslation2d.newInstance(); 657 658 /** 659 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 660 */ 661 private final ProtobufRotation2d rotation = ProtobufRotation2d.newInstance(); 662 663 private ProtobufPose2d() { 664 } 665 666 /** 667 * @return a new empty instance of {@code ProtobufPose2d} 668 */ 669 public static ProtobufPose2d newInstance() { 670 return new ProtobufPose2d(); 671 } 672 673 /** 674 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 675 * @return whether the translation field is set 676 */ 677 public boolean hasTranslation() { 678 return (bitField0_ & 0x00000001) != 0; 679 } 680 681 /** 682 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 683 * @return this 684 */ 685 public ProtobufPose2d clearTranslation() { 686 bitField0_ &= ~0x00000001; 687 translation.clear(); 688 return this; 689 } 690 691 /** 692 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 693 * 694 * This method returns the internal storage object without modifying any has state. 695 * The returned object should not be modified and be treated as read-only. 696 * 697 * Use {@link #getMutableTranslation()} if you want to modify it. 698 * 699 * @return internal storage object for reading 700 */ 701 public ProtobufTranslation2d getTranslation() { 702 return translation; 703 } 704 705 /** 706 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 707 * 708 * This method returns the internal storage object and sets the corresponding 709 * has state. The returned object will become part of this message and its 710 * contents may be modified as long as the has state is not cleared. 711 * 712 * @return internal storage object for modifications 713 */ 714 public ProtobufTranslation2d getMutableTranslation() { 715 bitField0_ |= 0x00000001; 716 return translation; 717 } 718 719 /** 720 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 721 * @param value the translation to set 722 * @return this 723 */ 724 public ProtobufPose2d setTranslation(final ProtobufTranslation2d value) { 725 bitField0_ |= 0x00000001; 726 translation.copyFrom(value); 727 return this; 728 } 729 730 /** 731 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 732 * @return whether the rotation field is set 733 */ 734 public boolean hasRotation() { 735 return (bitField0_ & 0x00000002) != 0; 736 } 737 738 /** 739 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 740 * @return this 741 */ 742 public ProtobufPose2d clearRotation() { 743 bitField0_ &= ~0x00000002; 744 rotation.clear(); 745 return this; 746 } 747 748 /** 749 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 750 * 751 * This method returns the internal storage object without modifying any has state. 752 * The returned object should not be modified and be treated as read-only. 753 * 754 * Use {@link #getMutableRotation()} if you want to modify it. 755 * 756 * @return internal storage object for reading 757 */ 758 public ProtobufRotation2d getRotation() { 759 return rotation; 760 } 761 762 /** 763 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 764 * 765 * This method returns the internal storage object and sets the corresponding 766 * has state. The returned object will become part of this message and its 767 * contents may be modified as long as the has state is not cleared. 768 * 769 * @return internal storage object for modifications 770 */ 771 public ProtobufRotation2d getMutableRotation() { 772 bitField0_ |= 0x00000002; 773 return rotation; 774 } 775 776 /** 777 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 778 * @param value the rotation to set 779 * @return this 780 */ 781 public ProtobufPose2d setRotation(final ProtobufRotation2d value) { 782 bitField0_ |= 0x00000002; 783 rotation.copyFrom(value); 784 return this; 785 } 786 787 @Override 788 public ProtobufPose2d copyFrom(final ProtobufPose2d other) { 789 cachedSize = other.cachedSize; 790 if ((bitField0_ | other.bitField0_) != 0) { 791 bitField0_ = other.bitField0_; 792 translation.copyFrom(other.translation); 793 rotation.copyFrom(other.rotation); 794 } 795 return this; 796 } 797 798 @Override 799 public ProtobufPose2d mergeFrom(final ProtobufPose2d other) { 800 if (other.isEmpty()) { 801 return this; 802 } 803 cachedSize = -1; 804 if (other.hasTranslation()) { 805 getMutableTranslation().mergeFrom(other.translation); 806 } 807 if (other.hasRotation()) { 808 getMutableRotation().mergeFrom(other.rotation); 809 } 810 return this; 811 } 812 813 @Override 814 public ProtobufPose2d clear() { 815 if (isEmpty()) { 816 return this; 817 } 818 cachedSize = -1; 819 bitField0_ = 0; 820 translation.clear(); 821 rotation.clear(); 822 return this; 823 } 824 825 @Override 826 public ProtobufPose2d clearQuick() { 827 if (isEmpty()) { 828 return this; 829 } 830 cachedSize = -1; 831 bitField0_ = 0; 832 translation.clearQuick(); 833 rotation.clearQuick(); 834 return this; 835 } 836 837 @Override 838 public boolean equals(Object o) { 839 if (o == this) { 840 return true; 841 } 842 if (!(o instanceof ProtobufPose2d)) { 843 return false; 844 } 845 ProtobufPose2d other = (ProtobufPose2d) o; 846 return bitField0_ == other.bitField0_ 847 && (!hasTranslation() || translation.equals(other.translation)) 848 && (!hasRotation() || rotation.equals(other.rotation)); 849 } 850 851 @Override 852 public void writeTo(final ProtoSink output) throws IOException { 853 if ((bitField0_ & 0x00000001) != 0) { 854 output.writeRawByte((byte) 10); 855 output.writeMessageNoTag(translation); 856 } 857 if ((bitField0_ & 0x00000002) != 0) { 858 output.writeRawByte((byte) 18); 859 output.writeMessageNoTag(rotation); 860 } 861 } 862 863 @Override 864 protected int computeSerializedSize() { 865 int size = 0; 866 if ((bitField0_ & 0x00000001) != 0) { 867 size += 1 + ProtoSink.computeMessageSizeNoTag(translation); 868 } 869 if ((bitField0_ & 0x00000002) != 0) { 870 size += 1 + ProtoSink.computeMessageSizeNoTag(rotation); 871 } 872 return size; 873 } 874 875 @Override 876 @SuppressWarnings("fallthrough") 877 public ProtobufPose2d mergeFrom(final ProtoSource input) throws IOException { 878 // Enabled Fall-Through Optimization (QuickBuffers) 879 int tag = input.readTag(); 880 while (true) { 881 switch (tag) { 882 case 10: { 883 // translation 884 input.readMessage(translation); 885 bitField0_ |= 0x00000001; 886 tag = input.readTag(); 887 if (tag != 18) { 888 break; 889 } 890 } 891 case 18: { 892 // rotation 893 input.readMessage(rotation); 894 bitField0_ |= 0x00000002; 895 tag = input.readTag(); 896 if (tag != 0) { 897 break; 898 } 899 } 900 case 0: { 901 return this; 902 } 903 default: { 904 if (!input.skipField(tag)) { 905 return this; 906 } 907 tag = input.readTag(); 908 break; 909 } 910 } 911 } 912 } 913 914 @Override 915 public void writeTo(final JsonSink output) throws IOException { 916 output.beginObject(); 917 if ((bitField0_ & 0x00000001) != 0) { 918 output.writeMessage(FieldNames.translation, translation); 919 } 920 if ((bitField0_ & 0x00000002) != 0) { 921 output.writeMessage(FieldNames.rotation, rotation); 922 } 923 output.endObject(); 924 } 925 926 @Override 927 public ProtobufPose2d mergeFrom(final JsonSource input) throws IOException { 928 if (!input.beginObject()) { 929 return this; 930 } 931 while (!input.isAtEnd()) { 932 switch (input.readFieldHash()) { 933 case -1840647503: { 934 if (input.isAtField(FieldNames.translation)) { 935 if (!input.trySkipNullValue()) { 936 input.readMessage(translation); 937 bitField0_ |= 0x00000001; 938 } 939 } else { 940 input.skipUnknownField(); 941 } 942 break; 943 } 944 case -40300674: { 945 if (input.isAtField(FieldNames.rotation)) { 946 if (!input.trySkipNullValue()) { 947 input.readMessage(rotation); 948 bitField0_ |= 0x00000002; 949 } 950 } else { 951 input.skipUnknownField(); 952 } 953 break; 954 } 955 default: { 956 input.skipUnknownField(); 957 break; 958 } 959 } 960 } 961 input.endObject(); 962 return this; 963 } 964 965 @Override 966 public ProtobufPose2d clone() { 967 return new ProtobufPose2d().copyFrom(this); 968 } 969 970 @Override 971 public boolean isEmpty() { 972 return ((bitField0_) == 0); 973 } 974 975 public static ProtobufPose2d parseFrom(final byte[] data) throws 976 InvalidProtocolBufferException { 977 return ProtoMessage.mergeFrom(new ProtobufPose2d(), data).checkInitialized(); 978 } 979 980 public static ProtobufPose2d parseFrom(final ProtoSource input) throws IOException { 981 return ProtoMessage.mergeFrom(new ProtobufPose2d(), input).checkInitialized(); 982 } 983 984 public static ProtobufPose2d parseFrom(final JsonSource input) throws IOException { 985 return ProtoMessage.mergeFrom(new ProtobufPose2d(), input).checkInitialized(); 986 } 987 988 /** 989 * @return factory for creating ProtobufPose2d messages 990 */ 991 public static MessageFactory<ProtobufPose2d> getFactory() { 992 return ProtobufPose2dFactory.INSTANCE; 993 } 994 995 /** 996 * @return this type's descriptor. 997 */ 998 public static Descriptors.Descriptor getDescriptor() { 999 return Geometry2D.wpi_proto_ProtobufPose2d_descriptor; 1000 } 1001 1002 private enum ProtobufPose2dFactory implements MessageFactory<ProtobufPose2d> { 1003 INSTANCE; 1004 1005 @Override 1006 public ProtobufPose2d create() { 1007 return ProtobufPose2d.newInstance(); 1008 } 1009 } 1010 1011 /** 1012 * Contains name constants used for serializing JSON 1013 */ 1014 static class FieldNames { 1015 static final FieldName translation = FieldName.forField("translation"); 1016 1017 static final FieldName rotation = FieldName.forField("rotation"); 1018 } 1019 } 1020 1021 /** 1022 * Protobuf type {@code ProtobufTransform2d} 1023 */ 1024 public static final class ProtobufTransform2d extends ProtoMessage<ProtobufTransform2d> implements Cloneable { 1025 private static final long serialVersionUID = 0L; 1026 1027 /** 1028 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 1029 */ 1030 private final ProtobufTranslation2d translation = ProtobufTranslation2d.newInstance(); 1031 1032 /** 1033 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 1034 */ 1035 private final ProtobufRotation2d rotation = ProtobufRotation2d.newInstance(); 1036 1037 private ProtobufTransform2d() { 1038 } 1039 1040 /** 1041 * @return a new empty instance of {@code ProtobufTransform2d} 1042 */ 1043 public static ProtobufTransform2d newInstance() { 1044 return new ProtobufTransform2d(); 1045 } 1046 1047 /** 1048 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 1049 * @return whether the translation field is set 1050 */ 1051 public boolean hasTranslation() { 1052 return (bitField0_ & 0x00000001) != 0; 1053 } 1054 1055 /** 1056 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 1057 * @return this 1058 */ 1059 public ProtobufTransform2d clearTranslation() { 1060 bitField0_ &= ~0x00000001; 1061 translation.clear(); 1062 return this; 1063 } 1064 1065 /** 1066 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 1067 * 1068 * This method returns the internal storage object without modifying any has state. 1069 * The returned object should not be modified and be treated as read-only. 1070 * 1071 * Use {@link #getMutableTranslation()} if you want to modify it. 1072 * 1073 * @return internal storage object for reading 1074 */ 1075 public ProtobufTranslation2d getTranslation() { 1076 return translation; 1077 } 1078 1079 /** 1080 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 1081 * 1082 * This method returns the internal storage object and sets the corresponding 1083 * has state. The returned object will become part of this message and its 1084 * contents may be modified as long as the has state is not cleared. 1085 * 1086 * @return internal storage object for modifications 1087 */ 1088 public ProtobufTranslation2d getMutableTranslation() { 1089 bitField0_ |= 0x00000001; 1090 return translation; 1091 } 1092 1093 /** 1094 * <code>optional .wpi.proto.ProtobufTranslation2d translation = 1;</code> 1095 * @param value the translation to set 1096 * @return this 1097 */ 1098 public ProtobufTransform2d setTranslation(final ProtobufTranslation2d value) { 1099 bitField0_ |= 0x00000001; 1100 translation.copyFrom(value); 1101 return this; 1102 } 1103 1104 /** 1105 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 1106 * @return whether the rotation field is set 1107 */ 1108 public boolean hasRotation() { 1109 return (bitField0_ & 0x00000002) != 0; 1110 } 1111 1112 /** 1113 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 1114 * @return this 1115 */ 1116 public ProtobufTransform2d clearRotation() { 1117 bitField0_ &= ~0x00000002; 1118 rotation.clear(); 1119 return this; 1120 } 1121 1122 /** 1123 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 1124 * 1125 * This method returns the internal storage object without modifying any has state. 1126 * The returned object should not be modified and be treated as read-only. 1127 * 1128 * Use {@link #getMutableRotation()} if you want to modify it. 1129 * 1130 * @return internal storage object for reading 1131 */ 1132 public ProtobufRotation2d getRotation() { 1133 return rotation; 1134 } 1135 1136 /** 1137 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 1138 * 1139 * This method returns the internal storage object and sets the corresponding 1140 * has state. The returned object will become part of this message and its 1141 * contents may be modified as long as the has state is not cleared. 1142 * 1143 * @return internal storage object for modifications 1144 */ 1145 public ProtobufRotation2d getMutableRotation() { 1146 bitField0_ |= 0x00000002; 1147 return rotation; 1148 } 1149 1150 /** 1151 * <code>optional .wpi.proto.ProtobufRotation2d rotation = 2;</code> 1152 * @param value the rotation to set 1153 * @return this 1154 */ 1155 public ProtobufTransform2d setRotation(final ProtobufRotation2d value) { 1156 bitField0_ |= 0x00000002; 1157 rotation.copyFrom(value); 1158 return this; 1159 } 1160 1161 @Override 1162 public ProtobufTransform2d copyFrom(final ProtobufTransform2d other) { 1163 cachedSize = other.cachedSize; 1164 if ((bitField0_ | other.bitField0_) != 0) { 1165 bitField0_ = other.bitField0_; 1166 translation.copyFrom(other.translation); 1167 rotation.copyFrom(other.rotation); 1168 } 1169 return this; 1170 } 1171 1172 @Override 1173 public ProtobufTransform2d mergeFrom(final ProtobufTransform2d other) { 1174 if (other.isEmpty()) { 1175 return this; 1176 } 1177 cachedSize = -1; 1178 if (other.hasTranslation()) { 1179 getMutableTranslation().mergeFrom(other.translation); 1180 } 1181 if (other.hasRotation()) { 1182 getMutableRotation().mergeFrom(other.rotation); 1183 } 1184 return this; 1185 } 1186 1187 @Override 1188 public ProtobufTransform2d clear() { 1189 if (isEmpty()) { 1190 return this; 1191 } 1192 cachedSize = -1; 1193 bitField0_ = 0; 1194 translation.clear(); 1195 rotation.clear(); 1196 return this; 1197 } 1198 1199 @Override 1200 public ProtobufTransform2d clearQuick() { 1201 if (isEmpty()) { 1202 return this; 1203 } 1204 cachedSize = -1; 1205 bitField0_ = 0; 1206 translation.clearQuick(); 1207 rotation.clearQuick(); 1208 return this; 1209 } 1210 1211 @Override 1212 public boolean equals(Object o) { 1213 if (o == this) { 1214 return true; 1215 } 1216 if (!(o instanceof ProtobufTransform2d)) { 1217 return false; 1218 } 1219 ProtobufTransform2d other = (ProtobufTransform2d) o; 1220 return bitField0_ == other.bitField0_ 1221 && (!hasTranslation() || translation.equals(other.translation)) 1222 && (!hasRotation() || rotation.equals(other.rotation)); 1223 } 1224 1225 @Override 1226 public void writeTo(final ProtoSink output) throws IOException { 1227 if ((bitField0_ & 0x00000001) != 0) { 1228 output.writeRawByte((byte) 10); 1229 output.writeMessageNoTag(translation); 1230 } 1231 if ((bitField0_ & 0x00000002) != 0) { 1232 output.writeRawByte((byte) 18); 1233 output.writeMessageNoTag(rotation); 1234 } 1235 } 1236 1237 @Override 1238 protected int computeSerializedSize() { 1239 int size = 0; 1240 if ((bitField0_ & 0x00000001) != 0) { 1241 size += 1 + ProtoSink.computeMessageSizeNoTag(translation); 1242 } 1243 if ((bitField0_ & 0x00000002) != 0) { 1244 size += 1 + ProtoSink.computeMessageSizeNoTag(rotation); 1245 } 1246 return size; 1247 } 1248 1249 @Override 1250 @SuppressWarnings("fallthrough") 1251 public ProtobufTransform2d mergeFrom(final ProtoSource input) throws IOException { 1252 // Enabled Fall-Through Optimization (QuickBuffers) 1253 int tag = input.readTag(); 1254 while (true) { 1255 switch (tag) { 1256 case 10: { 1257 // translation 1258 input.readMessage(translation); 1259 bitField0_ |= 0x00000001; 1260 tag = input.readTag(); 1261 if (tag != 18) { 1262 break; 1263 } 1264 } 1265 case 18: { 1266 // rotation 1267 input.readMessage(rotation); 1268 bitField0_ |= 0x00000002; 1269 tag = input.readTag(); 1270 if (tag != 0) { 1271 break; 1272 } 1273 } 1274 case 0: { 1275 return this; 1276 } 1277 default: { 1278 if (!input.skipField(tag)) { 1279 return this; 1280 } 1281 tag = input.readTag(); 1282 break; 1283 } 1284 } 1285 } 1286 } 1287 1288 @Override 1289 public void writeTo(final JsonSink output) throws IOException { 1290 output.beginObject(); 1291 if ((bitField0_ & 0x00000001) != 0) { 1292 output.writeMessage(FieldNames.translation, translation); 1293 } 1294 if ((bitField0_ & 0x00000002) != 0) { 1295 output.writeMessage(FieldNames.rotation, rotation); 1296 } 1297 output.endObject(); 1298 } 1299 1300 @Override 1301 public ProtobufTransform2d mergeFrom(final JsonSource input) throws IOException { 1302 if (!input.beginObject()) { 1303 return this; 1304 } 1305 while (!input.isAtEnd()) { 1306 switch (input.readFieldHash()) { 1307 case -1840647503: { 1308 if (input.isAtField(FieldNames.translation)) { 1309 if (!input.trySkipNullValue()) { 1310 input.readMessage(translation); 1311 bitField0_ |= 0x00000001; 1312 } 1313 } else { 1314 input.skipUnknownField(); 1315 } 1316 break; 1317 } 1318 case -40300674: { 1319 if (input.isAtField(FieldNames.rotation)) { 1320 if (!input.trySkipNullValue()) { 1321 input.readMessage(rotation); 1322 bitField0_ |= 0x00000002; 1323 } 1324 } else { 1325 input.skipUnknownField(); 1326 } 1327 break; 1328 } 1329 default: { 1330 input.skipUnknownField(); 1331 break; 1332 } 1333 } 1334 } 1335 input.endObject(); 1336 return this; 1337 } 1338 1339 @Override 1340 public ProtobufTransform2d clone() { 1341 return new ProtobufTransform2d().copyFrom(this); 1342 } 1343 1344 @Override 1345 public boolean isEmpty() { 1346 return ((bitField0_) == 0); 1347 } 1348 1349 public static ProtobufTransform2d parseFrom(final byte[] data) throws 1350 InvalidProtocolBufferException { 1351 return ProtoMessage.mergeFrom(new ProtobufTransform2d(), data).checkInitialized(); 1352 } 1353 1354 public static ProtobufTransform2d parseFrom(final ProtoSource input) throws IOException { 1355 return ProtoMessage.mergeFrom(new ProtobufTransform2d(), input).checkInitialized(); 1356 } 1357 1358 public static ProtobufTransform2d parseFrom(final JsonSource input) throws IOException { 1359 return ProtoMessage.mergeFrom(new ProtobufTransform2d(), input).checkInitialized(); 1360 } 1361 1362 /** 1363 * @return factory for creating ProtobufTransform2d messages 1364 */ 1365 public static MessageFactory<ProtobufTransform2d> getFactory() { 1366 return ProtobufTransform2dFactory.INSTANCE; 1367 } 1368 1369 /** 1370 * @return this type's descriptor. 1371 */ 1372 public static Descriptors.Descriptor getDescriptor() { 1373 return Geometry2D.wpi_proto_ProtobufTransform2d_descriptor; 1374 } 1375 1376 private enum ProtobufTransform2dFactory implements MessageFactory<ProtobufTransform2d> { 1377 INSTANCE; 1378 1379 @Override 1380 public ProtobufTransform2d create() { 1381 return ProtobufTransform2d.newInstance(); 1382 } 1383 } 1384 1385 /** 1386 * Contains name constants used for serializing JSON 1387 */ 1388 static class FieldNames { 1389 static final FieldName translation = FieldName.forField("translation"); 1390 1391 static final FieldName rotation = FieldName.forField("rotation"); 1392 } 1393 } 1394 1395 /** 1396 * Protobuf type {@code ProtobufTwist2d} 1397 */ 1398 public static final class ProtobufTwist2d extends ProtoMessage<ProtobufTwist2d> implements Cloneable { 1399 private static final long serialVersionUID = 0L; 1400 1401 /** 1402 * <code>optional double dx = 1;</code> 1403 */ 1404 private double dx; 1405 1406 /** 1407 * <code>optional double dy = 2;</code> 1408 */ 1409 private double dy; 1410 1411 /** 1412 * <code>optional double dtheta = 3;</code> 1413 */ 1414 private double dtheta; 1415 1416 private ProtobufTwist2d() { 1417 } 1418 1419 /** 1420 * @return a new empty instance of {@code ProtobufTwist2d} 1421 */ 1422 public static ProtobufTwist2d newInstance() { 1423 return new ProtobufTwist2d(); 1424 } 1425 1426 /** 1427 * <code>optional double dx = 1;</code> 1428 * @return whether the dx field is set 1429 */ 1430 public boolean hasDx() { 1431 return (bitField0_ & 0x00000001) != 0; 1432 } 1433 1434 /** 1435 * <code>optional double dx = 1;</code> 1436 * @return this 1437 */ 1438 public ProtobufTwist2d clearDx() { 1439 bitField0_ &= ~0x00000001; 1440 dx = 0D; 1441 return this; 1442 } 1443 1444 /** 1445 * <code>optional double dx = 1;</code> 1446 * @return the dx 1447 */ 1448 public double getDx() { 1449 return dx; 1450 } 1451 1452 /** 1453 * <code>optional double dx = 1;</code> 1454 * @param value the dx to set 1455 * @return this 1456 */ 1457 public ProtobufTwist2d setDx(final double value) { 1458 bitField0_ |= 0x00000001; 1459 dx = value; 1460 return this; 1461 } 1462 1463 /** 1464 * <code>optional double dy = 2;</code> 1465 * @return whether the dy field is set 1466 */ 1467 public boolean hasDy() { 1468 return (bitField0_ & 0x00000002) != 0; 1469 } 1470 1471 /** 1472 * <code>optional double dy = 2;</code> 1473 * @return this 1474 */ 1475 public ProtobufTwist2d clearDy() { 1476 bitField0_ &= ~0x00000002; 1477 dy = 0D; 1478 return this; 1479 } 1480 1481 /** 1482 * <code>optional double dy = 2;</code> 1483 * @return the dy 1484 */ 1485 public double getDy() { 1486 return dy; 1487 } 1488 1489 /** 1490 * <code>optional double dy = 2;</code> 1491 * @param value the dy to set 1492 * @return this 1493 */ 1494 public ProtobufTwist2d setDy(final double value) { 1495 bitField0_ |= 0x00000002; 1496 dy = value; 1497 return this; 1498 } 1499 1500 /** 1501 * <code>optional double dtheta = 3;</code> 1502 * @return whether the dtheta field is set 1503 */ 1504 public boolean hasDtheta() { 1505 return (bitField0_ & 0x00000004) != 0; 1506 } 1507 1508 /** 1509 * <code>optional double dtheta = 3;</code> 1510 * @return this 1511 */ 1512 public ProtobufTwist2d clearDtheta() { 1513 bitField0_ &= ~0x00000004; 1514 dtheta = 0D; 1515 return this; 1516 } 1517 1518 /** 1519 * <code>optional double dtheta = 3;</code> 1520 * @return the dtheta 1521 */ 1522 public double getDtheta() { 1523 return dtheta; 1524 } 1525 1526 /** 1527 * <code>optional double dtheta = 3;</code> 1528 * @param value the dtheta to set 1529 * @return this 1530 */ 1531 public ProtobufTwist2d setDtheta(final double value) { 1532 bitField0_ |= 0x00000004; 1533 dtheta = value; 1534 return this; 1535 } 1536 1537 @Override 1538 public ProtobufTwist2d copyFrom(final ProtobufTwist2d other) { 1539 cachedSize = other.cachedSize; 1540 if ((bitField0_ | other.bitField0_) != 0) { 1541 bitField0_ = other.bitField0_; 1542 dx = other.dx; 1543 dy = other.dy; 1544 dtheta = other.dtheta; 1545 } 1546 return this; 1547 } 1548 1549 @Override 1550 public ProtobufTwist2d mergeFrom(final ProtobufTwist2d other) { 1551 if (other.isEmpty()) { 1552 return this; 1553 } 1554 cachedSize = -1; 1555 if (other.hasDx()) { 1556 setDx(other.dx); 1557 } 1558 if (other.hasDy()) { 1559 setDy(other.dy); 1560 } 1561 if (other.hasDtheta()) { 1562 setDtheta(other.dtheta); 1563 } 1564 return this; 1565 } 1566 1567 @Override 1568 public ProtobufTwist2d clear() { 1569 if (isEmpty()) { 1570 return this; 1571 } 1572 cachedSize = -1; 1573 bitField0_ = 0; 1574 dx = 0D; 1575 dy = 0D; 1576 dtheta = 0D; 1577 return this; 1578 } 1579 1580 @Override 1581 public ProtobufTwist2d clearQuick() { 1582 if (isEmpty()) { 1583 return this; 1584 } 1585 cachedSize = -1; 1586 bitField0_ = 0; 1587 return this; 1588 } 1589 1590 @Override 1591 public boolean equals(Object o) { 1592 if (o == this) { 1593 return true; 1594 } 1595 if (!(o instanceof ProtobufTwist2d)) { 1596 return false; 1597 } 1598 ProtobufTwist2d other = (ProtobufTwist2d) o; 1599 return bitField0_ == other.bitField0_ 1600 && (!hasDx() || ProtoUtil.isEqual(dx, other.dx)) 1601 && (!hasDy() || ProtoUtil.isEqual(dy, other.dy)) 1602 && (!hasDtheta() || ProtoUtil.isEqual(dtheta, other.dtheta)); 1603 } 1604 1605 @Override 1606 public void writeTo(final ProtoSink output) throws IOException { 1607 if ((bitField0_ & 0x00000001) != 0) { 1608 output.writeRawByte((byte) 9); 1609 output.writeDoubleNoTag(dx); 1610 } 1611 if ((bitField0_ & 0x00000002) != 0) { 1612 output.writeRawByte((byte) 17); 1613 output.writeDoubleNoTag(dy); 1614 } 1615 if ((bitField0_ & 0x00000004) != 0) { 1616 output.writeRawByte((byte) 25); 1617 output.writeDoubleNoTag(dtheta); 1618 } 1619 } 1620 1621 @Override 1622 protected int computeSerializedSize() { 1623 int size = 0; 1624 if ((bitField0_ & 0x00000001) != 0) { 1625 size += 9; 1626 } 1627 if ((bitField0_ & 0x00000002) != 0) { 1628 size += 9; 1629 } 1630 if ((bitField0_ & 0x00000004) != 0) { 1631 size += 9; 1632 } 1633 return size; 1634 } 1635 1636 @Override 1637 @SuppressWarnings("fallthrough") 1638 public ProtobufTwist2d mergeFrom(final ProtoSource input) throws IOException { 1639 // Enabled Fall-Through Optimization (QuickBuffers) 1640 int tag = input.readTag(); 1641 while (true) { 1642 switch (tag) { 1643 case 9: { 1644 // dx 1645 dx = input.readDouble(); 1646 bitField0_ |= 0x00000001; 1647 tag = input.readTag(); 1648 if (tag != 17) { 1649 break; 1650 } 1651 } 1652 case 17: { 1653 // dy 1654 dy = input.readDouble(); 1655 bitField0_ |= 0x00000002; 1656 tag = input.readTag(); 1657 if (tag != 25) { 1658 break; 1659 } 1660 } 1661 case 25: { 1662 // dtheta 1663 dtheta = input.readDouble(); 1664 bitField0_ |= 0x00000004; 1665 tag = input.readTag(); 1666 if (tag != 0) { 1667 break; 1668 } 1669 } 1670 case 0: { 1671 return this; 1672 } 1673 default: { 1674 if (!input.skipField(tag)) { 1675 return this; 1676 } 1677 tag = input.readTag(); 1678 break; 1679 } 1680 } 1681 } 1682 } 1683 1684 @Override 1685 public void writeTo(final JsonSink output) throws IOException { 1686 output.beginObject(); 1687 if ((bitField0_ & 0x00000001) != 0) { 1688 output.writeDouble(FieldNames.dx, dx); 1689 } 1690 if ((bitField0_ & 0x00000002) != 0) { 1691 output.writeDouble(FieldNames.dy, dy); 1692 } 1693 if ((bitField0_ & 0x00000004) != 0) { 1694 output.writeDouble(FieldNames.dtheta, dtheta); 1695 } 1696 output.endObject(); 1697 } 1698 1699 @Override 1700 public ProtobufTwist2d mergeFrom(final JsonSource input) throws IOException { 1701 if (!input.beginObject()) { 1702 return this; 1703 } 1704 while (!input.isAtEnd()) { 1705 switch (input.readFieldHash()) { 1706 case 3220: { 1707 if (input.isAtField(FieldNames.dx)) { 1708 if (!input.trySkipNullValue()) { 1709 dx = input.readDouble(); 1710 bitField0_ |= 0x00000001; 1711 } 1712 } else { 1713 input.skipUnknownField(); 1714 } 1715 break; 1716 } 1717 case 3221: { 1718 if (input.isAtField(FieldNames.dy)) { 1719 if (!input.trySkipNullValue()) { 1720 dy = input.readDouble(); 1721 bitField0_ |= 0x00000002; 1722 } 1723 } else { 1724 input.skipUnknownField(); 1725 } 1726 break; 1727 } 1728 case -1321724742: { 1729 if (input.isAtField(FieldNames.dtheta)) { 1730 if (!input.trySkipNullValue()) { 1731 dtheta = input.readDouble(); 1732 bitField0_ |= 0x00000004; 1733 } 1734 } else { 1735 input.skipUnknownField(); 1736 } 1737 break; 1738 } 1739 default: { 1740 input.skipUnknownField(); 1741 break; 1742 } 1743 } 1744 } 1745 input.endObject(); 1746 return this; 1747 } 1748 1749 @Override 1750 public ProtobufTwist2d clone() { 1751 return new ProtobufTwist2d().copyFrom(this); 1752 } 1753 1754 @Override 1755 public boolean isEmpty() { 1756 return ((bitField0_) == 0); 1757 } 1758 1759 public static ProtobufTwist2d parseFrom(final byte[] data) throws 1760 InvalidProtocolBufferException { 1761 return ProtoMessage.mergeFrom(new ProtobufTwist2d(), data).checkInitialized(); 1762 } 1763 1764 public static ProtobufTwist2d parseFrom(final ProtoSource input) throws IOException { 1765 return ProtoMessage.mergeFrom(new ProtobufTwist2d(), input).checkInitialized(); 1766 } 1767 1768 public static ProtobufTwist2d parseFrom(final JsonSource input) throws IOException { 1769 return ProtoMessage.mergeFrom(new ProtobufTwist2d(), input).checkInitialized(); 1770 } 1771 1772 /** 1773 * @return factory for creating ProtobufTwist2d messages 1774 */ 1775 public static MessageFactory<ProtobufTwist2d> getFactory() { 1776 return ProtobufTwist2dFactory.INSTANCE; 1777 } 1778 1779 /** 1780 * @return this type's descriptor. 1781 */ 1782 public static Descriptors.Descriptor getDescriptor() { 1783 return Geometry2D.wpi_proto_ProtobufTwist2d_descriptor; 1784 } 1785 1786 private enum ProtobufTwist2dFactory implements MessageFactory<ProtobufTwist2d> { 1787 INSTANCE; 1788 1789 @Override 1790 public ProtobufTwist2d create() { 1791 return ProtobufTwist2d.newInstance(); 1792 } 1793 } 1794 1795 /** 1796 * Contains name constants used for serializing JSON 1797 */ 1798 static class FieldNames { 1799 static final FieldName dx = FieldName.forField("dx"); 1800 1801 static final FieldName dy = FieldName.forField("dy"); 1802 1803 static final FieldName dtheta = FieldName.forField("dtheta"); 1804 } 1805 } 1806}