23public final class ProtobufQuaternion extends ProtoMessage<ProtobufQuaternion> implements Cloneable {
24 private static final long serialVersionUID = 0L;
46 private ProtobufQuaternion() {
53 return new ProtobufQuaternion();
61 return (bitField0_ & 0x00000001) != 0;
69 bitField0_ &= ~0x00000001;
87 public ProtobufQuaternion
setW(
final double value) {
88 bitField0_ |= 0x00000001;
98 return (bitField0_ & 0x00000002) != 0;
106 bitField0_ &= ~0x00000002;
124 public ProtobufQuaternion
setX(
final double value) {
125 bitField0_ |= 0x00000002;
135 return (bitField0_ & 0x00000004) != 0;
143 bitField0_ &= ~0x00000004;
161 public ProtobufQuaternion
setY(
final double value) {
162 bitField0_ |= 0x00000004;
172 return (bitField0_ & 0x00000008) != 0;
180 bitField0_ &= ~0x00000008;
198 public ProtobufQuaternion
setZ(
final double value) {
199 bitField0_ |= 0x00000008;
206 cachedSize = other.cachedSize;
207 if ((bitField0_ | other.bitField0_) != 0) {
208 bitField0_ = other.bitField0_;
218 public ProtobufQuaternion mergeFrom(
final ProtobufQuaternion other) {
219 if (other.isEmpty()) {
263 public boolean equals(Object o) {
271 return bitField0_ == other.bitField0_
272 && (!hasW() || ProtoUtil.isEqual(w, other.w))
273 && (!hasX() || ProtoUtil.isEqual(x, other.x))
274 && (!hasY() || ProtoUtil.isEqual(y, other.y))
275 && (!hasZ() || ProtoUtil.isEqual(z, other.z));
279 public void writeTo(
final ProtoSink output)
throws IOException {
280 if ((bitField0_ & 0x00000001) != 0) {
281 output.writeRawByte((
byte) 9);
282 output.writeDoubleNoTag(w);
284 if ((bitField0_ & 0x00000002) != 0) {
285 output.writeRawByte((
byte) 17);
286 output.writeDoubleNoTag(x);
288 if ((bitField0_ & 0x00000004) != 0) {
289 output.writeRawByte((
byte) 25);
290 output.writeDoubleNoTag(y);
292 if ((bitField0_ & 0x00000008) != 0) {
293 output.writeRawByte((
byte) 33);
294 output.writeDoubleNoTag(z);
299 protected int computeSerializedSize() {
301 if ((bitField0_ & 0x00000001) != 0) {
304 if ((bitField0_ & 0x00000002) != 0) {
307 if ((bitField0_ & 0x00000004) != 0) {
310 if ((bitField0_ & 0x00000008) != 0) {
317 @SuppressWarnings(
"fallthrough")
320 int tag = input.readTag();
325 w = input.readDouble();
326 bitField0_ |= 0x00000001;
327 tag = input.readTag();
334 x = input.readDouble();
335 bitField0_ |= 0x00000002;
336 tag = input.readTag();
343 y = input.readDouble();
344 bitField0_ |= 0x00000004;
345 tag = input.readTag();
352 z = input.readDouble();
353 bitField0_ |= 0x00000008;
354 tag = input.readTag();
363 if (!input.skipField(tag)) {
366 tag = input.readTag();
374 public void writeTo(
final JsonSink output)
throws IOException {
375 output.beginObject();
376 if ((bitField0_ & 0x00000001) != 0) {
377 output.writeDouble(FieldNames.w, w);
379 if ((bitField0_ & 0x00000002) != 0) {
380 output.writeDouble(FieldNames.x, x);
382 if ((bitField0_ & 0x00000004) != 0) {
383 output.writeDouble(FieldNames.y, y);
385 if ((bitField0_ & 0x00000008) != 0) {
386 output.writeDouble(FieldNames.z, z);
393 if (!input.beginObject()) {
396 while (!input.isAtEnd()) {
397 switch (input.readFieldHash()) {
399 if (input.isAtField(FieldNames.w)) {
400 if (!input.trySkipNullValue()) {
401 w = input.readDouble();
402 bitField0_ |= 0x00000001;
405 input.skipUnknownField();
410 if (input.isAtField(FieldNames.x)) {
411 if (!input.trySkipNullValue()) {
412 x = input.readDouble();
413 bitField0_ |= 0x00000002;
416 input.skipUnknownField();
421 if (input.isAtField(FieldNames.y)) {
422 if (!input.trySkipNullValue()) {
423 y = input.readDouble();
424 bitField0_ |= 0x00000004;
427 input.skipUnknownField();
432 if (input.isAtField(FieldNames.z)) {
433 if (!input.trySkipNullValue()) {
434 z = input.readDouble();
435 bitField0_ |= 0x00000008;
438 input.skipUnknownField();
443 input.skipUnknownField();
458 public boolean isEmpty() {
459 return ((bitField0_) == 0);
463 InvalidProtocolBufferException {
467 public static ProtobufQuaternion parseFrom(
final ProtoSource input)
throws IOException {
471 public static ProtobufQuaternion parseFrom(
final JsonSource input)
throws IOException {
478 public static MessageFactory<ProtobufQuaternion>
getFactory() {
493 public ProtobufQuaternion create() {
494 return ProtobufQuaternion.newInstance();
501 static class FieldNames {
502 static final FieldName w = FieldName.forField(
"w");
504 static final FieldName x = FieldName.forField(
"x");
506 static final FieldName y = FieldName.forField(
"y");
508 static final FieldName z = FieldName.forField(
"z");