RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
ProtobufRotation3d.java
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4// Code generated by protocol buffer compiler. Do not edit!
5package org.wpilib.math.geometry.proto.detail;
6
7import java.io.IOException;
8import us.hebi.quickbuf.Descriptors;
9import us.hebi.quickbuf.FieldName;
10import us.hebi.quickbuf.InvalidProtocolBufferException;
11import us.hebi.quickbuf.JsonSink;
12import us.hebi.quickbuf.JsonSource;
13import us.hebi.quickbuf.MessageFactory;
14import us.hebi.quickbuf.ProtoMessage;
15import us.hebi.quickbuf.ProtoSink;
16import us.hebi.quickbuf.ProtoSource;
17
21@SuppressWarnings("hiding")
22public final class ProtobufRotation3d extends ProtoMessage<ProtobufRotation3d> implements Cloneable {
23 private static final long serialVersionUID = 0L;
24
29
30 private ProtobufRotation3d() {
31 }
32
36 public static ProtobufRotation3d newInstance() {
37 return new ProtobufRotation3d();
38 }
39
44 public boolean hasQ() {
45 return (bitField0_ & 0x00000001) != 0;
46 }
47
52 public ProtobufRotation3d clearQ() {
53 bitField0_ &= ~0x00000001;
54 q.clear();
55 return this;
56 }
57
69 return q;
70 }
71
82 bitField0_ |= 0x00000001;
83 return q;
84 }
85
91 public ProtobufRotation3d setQ(final ProtobufQuaternion value) {
92 bitField0_ |= 0x00000001;
93 q.copyFrom(value);
94 return this;
95 }
96
97 @Override
98 public ProtobufRotation3d copyFrom(final ProtobufRotation3d other) {
99 cachedSize = other.cachedSize;
100 if ((bitField0_ | other.bitField0_) != 0) {
101 bitField0_ = other.bitField0_;
102 q.copyFrom(other.q);
103 }
104 return this;
105 }
106
107 @Override
108 public ProtobufRotation3d mergeFrom(final ProtobufRotation3d other) {
109 if (other.isEmpty()) {
110 return this;
111 }
112 cachedSize = -1;
113 if (other.hasQ()) {
114 getMutableQ().mergeFrom(other.q);
115 }
116 return this;
117 }
118
119 @Override
120 public ProtobufRotation3d clear() {
121 if (isEmpty()) {
122 return this;
123 }
124 cachedSize = -1;
125 bitField0_ = 0;
126 q.clear();
127 return this;
128 }
129
130 @Override
131 public ProtobufRotation3d clearQuick() {
132 if (isEmpty()) {
133 return this;
134 }
135 cachedSize = -1;
136 bitField0_ = 0;
137 q.clearQuick();
138 return this;
139 }
140
141 @Override
142 public boolean equals(Object o) {
143 if (o == this) {
144 return true;
145 }
146 if (!(o instanceof ProtobufRotation3d)) {
147 return false;
148 }
150 return bitField0_ == other.bitField0_
151 && (!hasQ() || q.equals(other.q));
152 }
153
154 @Override
155 public void writeTo(final ProtoSink output) throws IOException {
156 if ((bitField0_ & 0x00000001) != 0) {
157 output.writeRawByte((byte) 10);
158 output.writeMessageNoTag(q);
159 }
160 }
161
162 @Override
163 protected int computeSerializedSize() {
164 int size = 0;
165 if ((bitField0_ & 0x00000001) != 0) {
166 size += 1 + ProtoSink.computeMessageSizeNoTag(q);
167 }
168 return size;
169 }
170
171 @Override
172 @SuppressWarnings("fallthrough")
173 public ProtobufRotation3d mergeFrom(final ProtoSource input) throws IOException {
174 // Enabled Fall-Through Optimization (QuickBuffers)
175 int tag = input.readTag();
176 while (true) {
177 switch (tag) {
178 case 10: {
179 // q
180 input.readMessage(q);
181 bitField0_ |= 0x00000001;
182 tag = input.readTag();
183 if (tag != 0) {
184 break;
185 }
186 }
187 case 0: {
188 return this;
189 }
190 default: {
191 if (!input.skipField(tag)) {
192 return this;
193 }
194 tag = input.readTag();
195 break;
196 }
197 }
198 }
199 }
200
201 @Override
202 public void writeTo(final JsonSink output) throws IOException {
203 output.beginObject();
204 if ((bitField0_ & 0x00000001) != 0) {
205 output.writeMessage(FieldNames.q, q);
206 }
207 output.endObject();
208 }
209
210 @Override
211 public ProtobufRotation3d mergeFrom(final JsonSource input) throws IOException {
212 if (!input.beginObject()) {
213 return this;
214 }
215 while (!input.isAtEnd()) {
216 switch (input.readFieldHash()) {
217 case 113: {
218 if (input.isAtField(FieldNames.q)) {
219 if (!input.trySkipNullValue()) {
220 input.readMessage(q);
221 bitField0_ |= 0x00000001;
222 }
223 } else {
224 input.skipUnknownField();
225 }
226 break;
227 }
228 default: {
229 input.skipUnknownField();
230 break;
231 }
232 }
233 }
234 input.endObject();
235 return this;
236 }
237
238 @Override
239 public ProtobufRotation3d clone() {
240 return new ProtobufRotation3d().copyFrom(this);
241 }
242
243 @Override
244 public boolean isEmpty() {
245 return ((bitField0_) == 0);
246 }
247
248 public static ProtobufRotation3d parseFrom(final byte[] data) throws
249 InvalidProtocolBufferException {
250 return ProtoMessage.mergeFrom(new ProtobufRotation3d(), data).checkInitialized();
251 }
252
253 public static ProtobufRotation3d parseFrom(final ProtoSource input) throws IOException {
254 return ProtoMessage.mergeFrom(new ProtobufRotation3d(), input).checkInitialized();
255 }
256
257 public static ProtobufRotation3d parseFrom(final JsonSource input) throws IOException {
258 return ProtoMessage.mergeFrom(new ProtobufRotation3d(), input).checkInitialized();
259 }
260
264 public static MessageFactory<ProtobufRotation3d> getFactory() {
265 return ProtobufRotation3dFactory.INSTANCE;
266 }
267
271 public static Descriptors.Descriptor getDescriptor() {
272 return ProtobufGeometry3dDescriptor.wpi_proto_ProtobufRotation3d_descriptor;
273 }
274
275 private enum ProtobufRotation3dFactory implements MessageFactory<ProtobufRotation3d> {
276 INSTANCE;
277
278 @Override
279 public ProtobufRotation3d create() {
280 return ProtobufRotation3d.newInstance();
281 }
282 }
283
287 static class FieldNames {
288 static final FieldName q = FieldName.forField("q");
289 }
290}
static MessageFactory< ProtobufRotation3d > getFactory()
ProtobufRotation3d setQ(final ProtobufQuaternion value)