23public final class ProtobufTranslation2d extends ProtoMessage<ProtobufTranslation2d> implements Cloneable {
24 private static final long serialVersionUID = 0L;
36 private ProtobufTranslation2d() {
43 return new ProtobufTranslation2d();
51 return (bitField0_ & 0x00000001) != 0;
58 public ProtobufTranslation2d
clearX() {
59 bitField0_ &= ~0x00000001;
77 public ProtobufTranslation2d
setX(
final double value) {
78 bitField0_ |= 0x00000001;
88 return (bitField0_ & 0x00000002) != 0;
95 public ProtobufTranslation2d
clearY() {
96 bitField0_ &= ~0x00000002;
114 public ProtobufTranslation2d
setY(
final double value) {
115 bitField0_ |= 0x00000002;
122 cachedSize = other.cachedSize;
123 if ((bitField0_ | other.bitField0_) != 0) {
124 bitField0_ = other.bitField0_;
132 public ProtobufTranslation2d mergeFrom(
final ProtobufTranslation2d other) {
133 if (other.isEmpty()) {
147 public ProtobufTranslation2d clear() {
169 public boolean equals(Object o) {
177 return bitField0_ == other.bitField0_
178 && (!hasX() || ProtoUtil.isEqual(x, other.x))
179 && (!hasY() || ProtoUtil.isEqual(y, other.y));
183 public void writeTo(
final ProtoSink output)
throws IOException {
184 if ((bitField0_ & 0x00000001) != 0) {
185 output.writeRawByte((
byte) 9);
186 output.writeDoubleNoTag(x);
188 if ((bitField0_ & 0x00000002) != 0) {
189 output.writeRawByte((
byte) 17);
190 output.writeDoubleNoTag(y);
195 protected int computeSerializedSize() {
197 if ((bitField0_ & 0x00000001) != 0) {
200 if ((bitField0_ & 0x00000002) != 0) {
207 @SuppressWarnings(
"fallthrough")
210 int tag = input.readTag();
215 x = input.readDouble();
216 bitField0_ |= 0x00000001;
217 tag = input.readTag();
224 y = input.readDouble();
225 bitField0_ |= 0x00000002;
226 tag = input.readTag();
235 if (!input.skipField(tag)) {
238 tag = input.readTag();
246 public void writeTo(
final JsonSink output)
throws IOException {
247 output.beginObject();
248 if ((bitField0_ & 0x00000001) != 0) {
249 output.writeDouble(FieldNames.x, x);
251 if ((bitField0_ & 0x00000002) != 0) {
252 output.writeDouble(FieldNames.y, y);
259 if (!input.beginObject()) {
262 while (!input.isAtEnd()) {
263 switch (input.readFieldHash()) {
265 if (input.isAtField(FieldNames.x)) {
266 if (!input.trySkipNullValue()) {
267 x = input.readDouble();
268 bitField0_ |= 0x00000001;
271 input.skipUnknownField();
276 if (input.isAtField(FieldNames.y)) {
277 if (!input.trySkipNullValue()) {
278 y = input.readDouble();
279 bitField0_ |= 0x00000002;
282 input.skipUnknownField();
287 input.skipUnknownField();
302 public boolean isEmpty() {
303 return ((bitField0_) == 0);
307 InvalidProtocolBufferException {
322 public static MessageFactory<ProtobufTranslation2d>
getFactory() {
337 public ProtobufTranslation2d create() {
338 return ProtobufTranslation2d.newInstance();
345 static class FieldNames {
346 static final FieldName x = FieldName.forField(
"x");
348 static final FieldName y = FieldName.forField(
"y");