Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / cacheinvalidation / src / java / com / google / ipc / invalidation / ticl / proto / AndroidService.java
1 /*
2  * Copyright 2011 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by j/c/g/ipc/invalidation/common/proto_wrapper_generator
17 package com.google.ipc.invalidation.ticl.proto;
18
19 import com.google.ipc.invalidation.util.Bytes;
20 import com.google.ipc.invalidation.util.ProtoWrapper;
21 import com.google.ipc.invalidation.util.ProtoWrapper.ValidationException;
22 import com.google.ipc.invalidation.util.TextBuilder;
23 import com.google.protobuf.nano.MessageNano;
24 import com.google.protobuf.nano.InvalidProtocolBufferNanoException;
25
26 import java.util.ArrayList;
27 import java.util.Collection;
28 import java.util.List;
29
30
31 public interface AndroidService {
32
33   public static final class ClientDowncall extends ProtoWrapper {
34     public static final class StartDowncall extends ProtoWrapper {
35       public static StartDowncall create() {
36         return new StartDowncall();
37       }
38
39       public static final StartDowncall DEFAULT_INSTANCE = new StartDowncall();
40
41
42       private StartDowncall() {
43       }
44
45
46       @Override public final boolean equals(Object obj) {
47         if (this == obj) { return true; }
48         if (!(obj instanceof StartDowncall)) { return false; }
49         StartDowncall other = (StartDowncall) obj;
50         return true;
51       }
52
53       @Override protected int computeHashCode() {
54         int result = 1;
55         return result;
56       }
57
58       @Override public void toCompactString(TextBuilder builder) {
59         builder.append("<StartDowncall:");
60         builder.append('>');
61       }
62
63       public static StartDowncall parseFrom(byte[] data) throws ValidationException {
64         try {
65           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StartDowncall(), data));
66         } catch (InvalidProtocolBufferNanoException exception) {
67           throw new ValidationException(exception);
68         } catch (ValidationArgumentException exception) {
69           throw new ValidationException(exception.getMessage());
70         }
71       }
72
73       static StartDowncall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StartDowncall message) {
74         if (message == null) { return null; }
75         return new StartDowncall();
76       }
77
78       public byte[] toByteArray() {
79         return MessageNano.toByteArray(toMessageNano());
80       }
81
82       com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StartDowncall toMessageNano() {
83         com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StartDowncall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StartDowncall();
84         return msg;
85       }
86     }
87     public static final class StopDowncall extends ProtoWrapper {
88       public static StopDowncall create() {
89         return new StopDowncall();
90       }
91
92       public static final StopDowncall DEFAULT_INSTANCE = new StopDowncall();
93
94
95       private StopDowncall() {
96       }
97
98
99       @Override public final boolean equals(Object obj) {
100         if (this == obj) { return true; }
101         if (!(obj instanceof StopDowncall)) { return false; }
102         StopDowncall other = (StopDowncall) obj;
103         return true;
104       }
105
106       @Override protected int computeHashCode() {
107         int result = 1;
108         return result;
109       }
110
111       @Override public void toCompactString(TextBuilder builder) {
112         builder.append("<StopDowncall:");
113         builder.append('>');
114       }
115
116       public static StopDowncall parseFrom(byte[] data) throws ValidationException {
117         try {
118           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StopDowncall(), data));
119         } catch (InvalidProtocolBufferNanoException exception) {
120           throw new ValidationException(exception);
121         } catch (ValidationArgumentException exception) {
122           throw new ValidationException(exception.getMessage());
123         }
124       }
125
126       static StopDowncall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StopDowncall message) {
127         if (message == null) { return null; }
128         return new StopDowncall();
129       }
130
131       public byte[] toByteArray() {
132         return MessageNano.toByteArray(toMessageNano());
133       }
134
135       com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StopDowncall toMessageNano() {
136         com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StopDowncall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.StopDowncall();
137         return msg;
138       }
139     }
140     public static final class AckDowncall extends ProtoWrapper {
141       public static AckDowncall create(Bytes ackHandle) {
142         return new AckDowncall(ackHandle);
143       }
144
145       private final Bytes ackHandle;
146
147       private AckDowncall(Bytes ackHandle) throws ValidationArgumentException {
148         required("ack_handle", ackHandle);
149         this.ackHandle = ackHandle;
150       }
151
152       public Bytes getAckHandle() { return ackHandle; }
153
154       @Override public final boolean equals(Object obj) {
155         if (this == obj) { return true; }
156         if (!(obj instanceof AckDowncall)) { return false; }
157         AckDowncall other = (AckDowncall) obj;
158         return equals(ackHandle, other.ackHandle);
159       }
160
161       @Override protected int computeHashCode() {
162         int result = 1;
163         result = result * 31 + ackHandle.hashCode();
164         return result;
165       }
166
167       @Override public void toCompactString(TextBuilder builder) {
168         builder.append("<AckDowncall:");
169         builder.append(" ack_handle=").append(ackHandle);
170         builder.append('>');
171       }
172
173       public static AckDowncall parseFrom(byte[] data) throws ValidationException {
174         try {
175           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.AckDowncall(), data));
176         } catch (InvalidProtocolBufferNanoException exception) {
177           throw new ValidationException(exception);
178         } catch (ValidationArgumentException exception) {
179           throw new ValidationException(exception.getMessage());
180         }
181       }
182
183       static AckDowncall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.AckDowncall message) {
184         if (message == null) { return null; }
185         return new AckDowncall(Bytes.fromByteArray(message.ackHandle));
186       }
187
188       public byte[] toByteArray() {
189         return MessageNano.toByteArray(toMessageNano());
190       }
191
192       com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.AckDowncall toMessageNano() {
193         com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.AckDowncall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.AckDowncall();
194         msg.ackHandle = ackHandle.getByteArray();
195         return msg;
196       }
197     }
198     public static final class RegistrationDowncall extends ProtoWrapper {
199       public static RegistrationDowncall createWithRegistrations(Collection<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> registrations) {
200         return new RegistrationDowncall(registrations, null);
201       }
202
203       public static RegistrationDowncall createWithUnregistrations(Collection<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> unregistrations) {
204         return new RegistrationDowncall(null, unregistrations);
205       }
206
207       private final List<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> registrations;
208       private final List<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> unregistrations;
209
210       private RegistrationDowncall(Collection<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> registrations,
211           Collection<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> unregistrations) throws ValidationArgumentException {
212         this.registrations = optional("registrations", registrations);
213         this.unregistrations = optional("unregistrations", unregistrations);
214         String existingOneOfField = null;
215         if (!this.registrations.isEmpty()) {
216           existingOneOfField = "registrations";
217         }
218         if (!this.unregistrations.isEmpty()) {
219           if (existingOneOfField != null) {
220             oneOfViolation(existingOneOfField, "unregistrations");
221           }
222           existingOneOfField = "unregistrations";
223         }
224         if (existingOneOfField == null) { oneOfViolation(); }
225       }
226
227       public List<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> getRegistrations() { return registrations; }
228
229       public List<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> getUnregistrations() { return unregistrations; }
230
231       @Override public final boolean equals(Object obj) {
232         if (this == obj) { return true; }
233         if (!(obj instanceof RegistrationDowncall)) { return false; }
234         RegistrationDowncall other = (RegistrationDowncall) obj;
235         return equals(registrations, other.registrations)
236             && equals(unregistrations, other.unregistrations);
237       }
238
239       @Override protected int computeHashCode() {
240         int result = 1;
241         result = result * 31 + registrations.hashCode();
242         result = result * 31 + unregistrations.hashCode();
243         return result;
244       }
245
246       @Override public void toCompactString(TextBuilder builder) {
247         builder.append("<RegistrationDowncall:");
248         builder.append(" registrations=[").append(registrations).append(']');
249         builder.append(" unregistrations=[").append(unregistrations).append(']');
250         builder.append('>');
251       }
252
253       public static RegistrationDowncall parseFrom(byte[] data) throws ValidationException {
254         try {
255           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.RegistrationDowncall(), data));
256         } catch (InvalidProtocolBufferNanoException exception) {
257           throw new ValidationException(exception);
258         } catch (ValidationArgumentException exception) {
259           throw new ValidationException(exception.getMessage());
260         }
261       }
262
263       static RegistrationDowncall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.RegistrationDowncall message) {
264         if (message == null) { return null; }
265         List<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> registrations = new ArrayList<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP>(message.registrations.length);
266         for (int i = 0; i < message.registrations.length; i++) {
267           registrations.add(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP.fromMessageNano(message.registrations[i]));
268         }
269         List<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP> unregistrations = new ArrayList<com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP>(message.unregistrations.length);
270         for (int i = 0; i < message.unregistrations.length; i++) {
271           unregistrations.add(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP.fromMessageNano(message.unregistrations[i]));
272         }
273         return new RegistrationDowncall(registrations,
274             unregistrations);
275       }
276
277       public byte[] toByteArray() {
278         return MessageNano.toByteArray(toMessageNano());
279       }
280
281       com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.RegistrationDowncall toMessageNano() {
282         com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.RegistrationDowncall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall.RegistrationDowncall();
283         msg.registrations = new com.google.protos.ipc.invalidation.NanoClientProtocol.ObjectIdP[registrations.size()];
284         for (int i = 0; i < msg.registrations.length; i++) {
285           msg.registrations[i] = registrations.get(i).toMessageNano();
286         }
287         msg.unregistrations = new com.google.protos.ipc.invalidation.NanoClientProtocol.ObjectIdP[unregistrations.size()];
288         for (int i = 0; i < msg.unregistrations.length; i++) {
289           msg.unregistrations[i] = unregistrations.get(i).toMessageNano();
290         }
291         return msg;
292       }
293     }
294     public static ClientDowncall createWithSerial(long serial,
295         com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version) {
296       return new ClientDowncall(serial, version, null, null, null, null);
297     }
298
299     public static ClientDowncall createWithStart(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
300         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StartDowncall start) {
301       return new ClientDowncall(null, version, start, null, null, null);
302     }
303
304     public static ClientDowncall createWithStop(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
305         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StopDowncall stop) {
306       return new ClientDowncall(null, version, null, stop, null, null);
307     }
308
309     public static ClientDowncall createWithAck(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
310         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.AckDowncall ack) {
311       return new ClientDowncall(null, version, null, null, ack, null);
312     }
313
314     public static ClientDowncall createWithRegistrations(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
315         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.RegistrationDowncall registrations) {
316       return new ClientDowncall(null, version, null, null, null, registrations);
317     }
318
319     private final long __hazzerBits;
320     private final long serial;
321     private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version;
322     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StartDowncall start;
323     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StopDowncall stop;
324     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.AckDowncall ack;
325     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.RegistrationDowncall registrations;
326
327     private ClientDowncall(Long serial,
328         com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
329         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StartDowncall start,
330         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StopDowncall stop,
331         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.AckDowncall ack,
332         com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.RegistrationDowncall registrations) throws ValidationArgumentException {
333       int hazzerBits = 0;
334       if (serial != null) {
335         hazzerBits |= 0x1;
336         this.serial = serial;
337       } else {
338         this.serial = 0;
339       }
340       required("version", version);
341       this.version = version;
342       if (start != null) {
343         hazzerBits |= 0x2;
344         this.start = start;
345       } else {
346         this.start = com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StartDowncall.DEFAULT_INSTANCE;
347       }
348       if (stop != null) {
349         hazzerBits |= 0x4;
350         this.stop = stop;
351       } else {
352         this.stop = com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StopDowncall.DEFAULT_INSTANCE;
353       }
354       this.ack = ack;
355       this.registrations = registrations;
356       this.__hazzerBits = hazzerBits;
357       String existingOneOfField = null;
358       if (hasStop()) {
359         existingOneOfField = "stop";
360       }
361       if (hasStart()) {
362         if (existingOneOfField != null) {
363           oneOfViolation(existingOneOfField, "start");
364         }
365         existingOneOfField = "start";
366       }
367       if (hasSerial()) {
368         if (existingOneOfField != null) {
369           oneOfViolation(existingOneOfField, "serial");
370         }
371         existingOneOfField = "serial";
372       }
373       if (this.registrations != null) {
374         if (existingOneOfField != null) {
375           oneOfViolation(existingOneOfField, "registrations");
376         }
377         existingOneOfField = "registrations";
378       }
379       if (this.ack != null) {
380         if (existingOneOfField != null) {
381           oneOfViolation(existingOneOfField, "ack");
382         }
383         existingOneOfField = "ack";
384       }
385       if (existingOneOfField == null) { oneOfViolation(); }
386     }
387
388     public long getSerial() { return serial; }
389     public boolean hasSerial() { return (0x1 & __hazzerBits) != 0; }
390
391     public com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version getVersion() { return version; }
392
393     public com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StartDowncall getStart() { return start; }
394     public boolean hasStart() { return (0x2 & __hazzerBits) != 0; }
395
396     public com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StopDowncall getStop() { return stop; }
397     public boolean hasStop() { return (0x4 & __hazzerBits) != 0; }
398
399     public com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.AckDowncall getNullableAck() { return ack; }
400
401     public com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.RegistrationDowncall getNullableRegistrations() { return registrations; }
402
403     @Override public final boolean equals(Object obj) {
404       if (this == obj) { return true; }
405       if (!(obj instanceof ClientDowncall)) { return false; }
406       ClientDowncall other = (ClientDowncall) obj;
407       return __hazzerBits == other.__hazzerBits
408           && (!hasSerial() || serial == other.serial)
409           && equals(version, other.version)
410           && (!hasStart() || equals(start, other.start))
411           && (!hasStop() || equals(stop, other.stop))
412           && equals(ack, other.ack)
413           && equals(registrations, other.registrations);
414     }
415
416     @Override protected int computeHashCode() {
417       int result = hash(__hazzerBits);
418       if (hasSerial()) {
419         result = result * 31 + hash(serial);
420       }
421       result = result * 31 + version.hashCode();
422       if (hasStart()) {
423         result = result * 31 + start.hashCode();
424       }
425       if (hasStop()) {
426         result = result * 31 + stop.hashCode();
427       }
428       if (ack != null) {
429         result = result * 31 + ack.hashCode();
430       }
431       if (registrations != null) {
432         result = result * 31 + registrations.hashCode();
433       }
434       return result;
435     }
436
437     @Override public void toCompactString(TextBuilder builder) {
438       builder.append("<ClientDowncall:");
439       if (hasSerial()) {
440         builder.append(" serial=").append(serial);
441       }
442       builder.append(" version=").append(version);
443       if (hasStart()) {
444         builder.append(" start=").append(start);
445       }
446       if (hasStop()) {
447         builder.append(" stop=").append(stop);
448       }
449       if (ack != null) {
450         builder.append(" ack=").append(ack);
451       }
452       if (registrations != null) {
453         builder.append(" registrations=").append(registrations);
454       }
455       builder.append('>');
456     }
457
458     public static ClientDowncall parseFrom(byte[] data) throws ValidationException {
459       try {
460         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall(), data));
461       } catch (InvalidProtocolBufferNanoException exception) {
462         throw new ValidationException(exception);
463       } catch (ValidationArgumentException exception) {
464         throw new ValidationException(exception.getMessage());
465       }
466     }
467
468     static ClientDowncall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall message) {
469       if (message == null) { return null; }
470       return new ClientDowncall(message.serial,
471           com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version.fromMessageNano(message.version),
472           com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StartDowncall.fromMessageNano(message.start),
473           com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.StopDowncall.fromMessageNano(message.stop),
474           com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.AckDowncall.fromMessageNano(message.ack),
475           com.google.ipc.invalidation.ticl.proto.AndroidService.ClientDowncall.RegistrationDowncall.fromMessageNano(message.registrations));
476     }
477
478     public byte[] toByteArray() {
479       return MessageNano.toByteArray(toMessageNano());
480     }
481
482     com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall toMessageNano() {
483       com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ClientDowncall();
484       msg.serial = hasSerial() ? serial : null;
485       msg.version = version.toMessageNano();
486       msg.start = hasStart() ? start.toMessageNano() : null;
487       msg.stop = hasStop() ? stop.toMessageNano() : null;
488       msg.ack = this.ack != null ? ack.toMessageNano() : null;
489       msg.registrations = this.registrations != null ? registrations.toMessageNano() : null;
490       return msg;
491     }
492   }
493
494   public static final class InternalDowncall extends ProtoWrapper {
495     public static final class ServerMessage extends ProtoWrapper {
496       public static ServerMessage create(Bytes data) {
497         return new ServerMessage(data);
498       }
499
500       private final Bytes data;
501
502       private ServerMessage(Bytes data) throws ValidationArgumentException {
503         required("data", data);
504         this.data = data;
505       }
506
507       public Bytes getData() { return data; }
508
509       @Override public final boolean equals(Object obj) {
510         if (this == obj) { return true; }
511         if (!(obj instanceof ServerMessage)) { return false; }
512         ServerMessage other = (ServerMessage) obj;
513         return equals(data, other.data);
514       }
515
516       @Override protected int computeHashCode() {
517         int result = 1;
518         result = result * 31 + data.hashCode();
519         return result;
520       }
521
522       @Override public void toCompactString(TextBuilder builder) {
523         builder.append("<ServerMessage:");
524         builder.append(" data=").append(data);
525         builder.append('>');
526       }
527
528       public static ServerMessage parseFrom(byte[] data) throws ValidationException {
529         try {
530           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.ServerMessage(), data));
531         } catch (InvalidProtocolBufferNanoException exception) {
532           throw new ValidationException(exception);
533         } catch (ValidationArgumentException exception) {
534           throw new ValidationException(exception.getMessage());
535         }
536       }
537
538       static ServerMessage fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.ServerMessage message) {
539         if (message == null) { return null; }
540         return new ServerMessage(Bytes.fromByteArray(message.data));
541       }
542
543       public byte[] toByteArray() {
544         return MessageNano.toByteArray(toMessageNano());
545       }
546
547       com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.ServerMessage toMessageNano() {
548         com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.ServerMessage msg = new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.ServerMessage();
549         msg.data = data.getByteArray();
550         return msg;
551       }
552     }
553     public static final class NetworkStatus extends ProtoWrapper {
554       public static NetworkStatus create(boolean isOnline) {
555         return new NetworkStatus(isOnline);
556       }
557
558       private final boolean isOnline;
559
560       private NetworkStatus(Boolean isOnline) throws ValidationArgumentException {
561         required("is_online", isOnline);
562         this.isOnline = isOnline;
563       }
564
565       public boolean getIsOnline() { return isOnline; }
566
567       @Override public final boolean equals(Object obj) {
568         if (this == obj) { return true; }
569         if (!(obj instanceof NetworkStatus)) { return false; }
570         NetworkStatus other = (NetworkStatus) obj;
571         return isOnline == other.isOnline;
572       }
573
574       @Override protected int computeHashCode() {
575         int result = 1;
576         result = result * 31 + hash(isOnline);
577         return result;
578       }
579
580       @Override public void toCompactString(TextBuilder builder) {
581         builder.append("<NetworkStatus:");
582         builder.append(" is_online=").append(isOnline);
583         builder.append('>');
584       }
585
586       public static NetworkStatus parseFrom(byte[] data) throws ValidationException {
587         try {
588           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.NetworkStatus(), data));
589         } catch (InvalidProtocolBufferNanoException exception) {
590           throw new ValidationException(exception);
591         } catch (ValidationArgumentException exception) {
592           throw new ValidationException(exception.getMessage());
593         }
594       }
595
596       static NetworkStatus fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.NetworkStatus message) {
597         if (message == null) { return null; }
598         return new NetworkStatus(message.isOnline);
599       }
600
601       public byte[] toByteArray() {
602         return MessageNano.toByteArray(toMessageNano());
603       }
604
605       com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.NetworkStatus toMessageNano() {
606         com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.NetworkStatus msg = new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.NetworkStatus();
607         msg.isOnline = isOnline;
608         return msg;
609       }
610     }
611     public static final class CreateClient extends ProtoWrapper {
612       public static CreateClient create(int clientType,
613           Bytes clientName,
614           com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP clientConfig,
615           boolean skipStartForTest) {
616         return new CreateClient(clientType, clientName, clientConfig, skipStartForTest);
617       }
618
619       private final int clientType;
620       private final Bytes clientName;
621       private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP clientConfig;
622       private final boolean skipStartForTest;
623
624       private CreateClient(Integer clientType,
625           Bytes clientName,
626           com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP clientConfig,
627           Boolean skipStartForTest) throws ValidationArgumentException {
628         required("client_type", clientType);
629         this.clientType = clientType;
630         required("client_name", clientName);
631         this.clientName = clientName;
632         required("client_config", clientConfig);
633         this.clientConfig = clientConfig;
634         required("skip_start_for_test", skipStartForTest);
635         this.skipStartForTest = skipStartForTest;
636       }
637
638       public int getClientType() { return clientType; }
639
640       public Bytes getClientName() { return clientName; }
641
642       public com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP getClientConfig() { return clientConfig; }
643
644       public boolean getSkipStartForTest() { return skipStartForTest; }
645
646       @Override public final boolean equals(Object obj) {
647         if (this == obj) { return true; }
648         if (!(obj instanceof CreateClient)) { return false; }
649         CreateClient other = (CreateClient) obj;
650         return clientType == other.clientType
651             && equals(clientName, other.clientName)
652             && equals(clientConfig, other.clientConfig)
653             && skipStartForTest == other.skipStartForTest;
654       }
655
656       @Override protected int computeHashCode() {
657         int result = 1;
658         result = result * 31 + hash(clientType);
659         result = result * 31 + clientName.hashCode();
660         result = result * 31 + clientConfig.hashCode();
661         result = result * 31 + hash(skipStartForTest);
662         return result;
663       }
664
665       @Override public void toCompactString(TextBuilder builder) {
666         builder.append("<CreateClient:");
667         builder.append(" client_type=").append(clientType);
668         builder.append(" client_name=").append(clientName);
669         builder.append(" client_config=").append(clientConfig);
670         builder.append(" skip_start_for_test=").append(skipStartForTest);
671         builder.append('>');
672       }
673
674       public static CreateClient parseFrom(byte[] data) throws ValidationException {
675         try {
676           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.CreateClient(), data));
677         } catch (InvalidProtocolBufferNanoException exception) {
678           throw new ValidationException(exception);
679         } catch (ValidationArgumentException exception) {
680           throw new ValidationException(exception.getMessage());
681         }
682       }
683
684       static CreateClient fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.CreateClient message) {
685         if (message == null) { return null; }
686         return new CreateClient(message.clientType,
687             Bytes.fromByteArray(message.clientName),
688             com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP.fromMessageNano(message.clientConfig),
689             message.skipStartForTest);
690       }
691
692       public byte[] toByteArray() {
693         return MessageNano.toByteArray(toMessageNano());
694       }
695
696       com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.CreateClient toMessageNano() {
697         com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.CreateClient msg = new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall.CreateClient();
698         msg.clientType = clientType;
699         msg.clientName = clientName.getByteArray();
700         msg.clientConfig = clientConfig.toMessageNano();
701         msg.skipStartForTest = skipStartForTest;
702         return msg;
703       }
704     }
705     public static InternalDowncall createWithServerMessage(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
706         com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.ServerMessage serverMessage) {
707       return new InternalDowncall(version, serverMessage, null, null, null);
708     }
709
710     public static InternalDowncall createWithNetworkStatus(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
711         com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.NetworkStatus networkStatus) {
712       return new InternalDowncall(version, null, networkStatus, null, null);
713     }
714
715     public static InternalDowncall createWithNetworkAddrChange(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
716         boolean networkAddrChange) {
717       return new InternalDowncall(version, null, null, networkAddrChange, null);
718     }
719
720     public static InternalDowncall createWithCreateClient(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
721         com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.CreateClient createClient) {
722       return new InternalDowncall(version, null, null, null, createClient);
723     }
724
725     private final long __hazzerBits;
726     private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version;
727     private final com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.ServerMessage serverMessage;
728     private final com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.NetworkStatus networkStatus;
729     private final boolean networkAddrChange;
730     private final com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.CreateClient createClient;
731
732     private InternalDowncall(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
733         com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.ServerMessage serverMessage,
734         com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.NetworkStatus networkStatus,
735         Boolean networkAddrChange,
736         com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.CreateClient createClient) throws ValidationArgumentException {
737       int hazzerBits = 0;
738       required("version", version);
739       this.version = version;
740       this.serverMessage = serverMessage;
741       this.networkStatus = networkStatus;
742       if (networkAddrChange != null) {
743         hazzerBits |= 0x1;
744         this.networkAddrChange = networkAddrChange;
745       } else {
746         this.networkAddrChange = false;
747       }
748       this.createClient = createClient;
749       this.__hazzerBits = hazzerBits;
750       String existingOneOfField = null;
751       if (hasNetworkAddrChange()) {
752         existingOneOfField = "network_addr_change";
753       }
754       if (this.networkStatus != null) {
755         if (existingOneOfField != null) {
756           oneOfViolation(existingOneOfField, "network_status");
757         }
758         existingOneOfField = "network_status";
759       }
760       if (this.createClient != null) {
761         if (existingOneOfField != null) {
762           oneOfViolation(existingOneOfField, "create_client");
763         }
764         existingOneOfField = "create_client";
765       }
766       if (this.serverMessage != null) {
767         if (existingOneOfField != null) {
768           oneOfViolation(existingOneOfField, "server_message");
769         }
770         existingOneOfField = "server_message";
771       }
772       if (existingOneOfField == null) { oneOfViolation(); }
773     }
774
775     public com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version getVersion() { return version; }
776
777     public com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.ServerMessage getNullableServerMessage() { return serverMessage; }
778
779     public com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.NetworkStatus getNullableNetworkStatus() { return networkStatus; }
780
781     public boolean getNetworkAddrChange() { return networkAddrChange; }
782     public boolean hasNetworkAddrChange() { return (0x1 & __hazzerBits) != 0; }
783
784     public com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.CreateClient getNullableCreateClient() { return createClient; }
785
786     @Override public final boolean equals(Object obj) {
787       if (this == obj) { return true; }
788       if (!(obj instanceof InternalDowncall)) { return false; }
789       InternalDowncall other = (InternalDowncall) obj;
790       return __hazzerBits == other.__hazzerBits
791           && equals(version, other.version)
792           && equals(serverMessage, other.serverMessage)
793           && equals(networkStatus, other.networkStatus)
794           && (!hasNetworkAddrChange() || networkAddrChange == other.networkAddrChange)
795           && equals(createClient, other.createClient);
796     }
797
798     @Override protected int computeHashCode() {
799       int result = hash(__hazzerBits);
800       result = result * 31 + version.hashCode();
801       if (serverMessage != null) {
802         result = result * 31 + serverMessage.hashCode();
803       }
804       if (networkStatus != null) {
805         result = result * 31 + networkStatus.hashCode();
806       }
807       if (hasNetworkAddrChange()) {
808         result = result * 31 + hash(networkAddrChange);
809       }
810       if (createClient != null) {
811         result = result * 31 + createClient.hashCode();
812       }
813       return result;
814     }
815
816     @Override public void toCompactString(TextBuilder builder) {
817       builder.append("<InternalDowncall:");
818       builder.append(" version=").append(version);
819       if (serverMessage != null) {
820         builder.append(" server_message=").append(serverMessage);
821       }
822       if (networkStatus != null) {
823         builder.append(" network_status=").append(networkStatus);
824       }
825       if (hasNetworkAddrChange()) {
826         builder.append(" network_addr_change=").append(networkAddrChange);
827       }
828       if (createClient != null) {
829         builder.append(" create_client=").append(createClient);
830       }
831       builder.append('>');
832     }
833
834     public static InternalDowncall parseFrom(byte[] data) throws ValidationException {
835       try {
836         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall(), data));
837       } catch (InvalidProtocolBufferNanoException exception) {
838         throw new ValidationException(exception);
839       } catch (ValidationArgumentException exception) {
840         throw new ValidationException(exception.getMessage());
841       }
842     }
843
844     static InternalDowncall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall message) {
845       if (message == null) { return null; }
846       return new InternalDowncall(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version.fromMessageNano(message.version),
847           com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.ServerMessage.fromMessageNano(message.serverMessage),
848           com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.NetworkStatus.fromMessageNano(message.networkStatus),
849           message.networkAddrChange,
850           com.google.ipc.invalidation.ticl.proto.AndroidService.InternalDowncall.CreateClient.fromMessageNano(message.createClient));
851     }
852
853     public byte[] toByteArray() {
854       return MessageNano.toByteArray(toMessageNano());
855     }
856
857     com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall toMessageNano() {
858       com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.InternalDowncall();
859       msg.version = version.toMessageNano();
860       msg.serverMessage = this.serverMessage != null ? serverMessage.toMessageNano() : null;
861       msg.networkStatus = this.networkStatus != null ? networkStatus.toMessageNano() : null;
862       msg.networkAddrChange = hasNetworkAddrChange() ? networkAddrChange : null;
863       msg.createClient = this.createClient != null ? createClient.toMessageNano() : null;
864       return msg;
865     }
866   }
867
868   public static final class ListenerUpcall extends ProtoWrapper {
869     public static final class ReadyUpcall extends ProtoWrapper {
870       public static ReadyUpcall create() {
871         return new ReadyUpcall();
872       }
873
874       public static final ReadyUpcall DEFAULT_INSTANCE = new ReadyUpcall();
875
876
877       private ReadyUpcall() {
878       }
879
880
881       @Override public final boolean equals(Object obj) {
882         if (this == obj) { return true; }
883         if (!(obj instanceof ReadyUpcall)) { return false; }
884         ReadyUpcall other = (ReadyUpcall) obj;
885         return true;
886       }
887
888       @Override protected int computeHashCode() {
889         int result = 1;
890         return result;
891       }
892
893       @Override public void toCompactString(TextBuilder builder) {
894         builder.append("<ReadyUpcall:");
895         builder.append('>');
896       }
897
898       public static ReadyUpcall parseFrom(byte[] data) throws ValidationException {
899         try {
900           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReadyUpcall(), data));
901         } catch (InvalidProtocolBufferNanoException exception) {
902           throw new ValidationException(exception);
903         } catch (ValidationArgumentException exception) {
904           throw new ValidationException(exception.getMessage());
905         }
906       }
907
908       static ReadyUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReadyUpcall message) {
909         if (message == null) { return null; }
910         return new ReadyUpcall();
911       }
912
913       public byte[] toByteArray() {
914         return MessageNano.toByteArray(toMessageNano());
915       }
916
917       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReadyUpcall toMessageNano() {
918         com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReadyUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReadyUpcall();
919         return msg;
920       }
921     }
922     public static final class InvalidateUpcall extends ProtoWrapper {
923       public static InvalidateUpcall createWithInvalidation(Bytes ackHandle,
924           com.google.ipc.invalidation.ticl.proto.ClientProtocol.InvalidationP invalidation) {
925         return new InvalidateUpcall(ackHandle, invalidation, null, null);
926       }
927
928       public static InvalidateUpcall createWithInvalidateUnknown(Bytes ackHandle,
929           com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP invalidateUnknown) {
930         return new InvalidateUpcall(ackHandle, null, invalidateUnknown, null);
931       }
932
933       public static InvalidateUpcall createWithInvalidateAll(Bytes ackHandle,
934           boolean invalidateAll) {
935         return new InvalidateUpcall(ackHandle, null, null, invalidateAll);
936       }
937
938       private final long __hazzerBits;
939       private final Bytes ackHandle;
940       private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.InvalidationP invalidation;
941       private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP invalidateUnknown;
942       private final boolean invalidateAll;
943
944       private InvalidateUpcall(Bytes ackHandle,
945           com.google.ipc.invalidation.ticl.proto.ClientProtocol.InvalidationP invalidation,
946           com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP invalidateUnknown,
947           Boolean invalidateAll) throws ValidationArgumentException {
948         int hazzerBits = 0;
949         required("ack_handle", ackHandle);
950         this.ackHandle = ackHandle;
951         this.invalidation = invalidation;
952         this.invalidateUnknown = invalidateUnknown;
953         if (invalidateAll != null) {
954           hazzerBits |= 0x1;
955           this.invalidateAll = invalidateAll;
956         } else {
957           this.invalidateAll = false;
958         }
959         this.__hazzerBits = hazzerBits;
960         String existingOneOfField = null;
961         if (this.invalidateUnknown != null) {
962           existingOneOfField = "invalidate_unknown";
963         }
964         if (this.invalidation != null) {
965           if (existingOneOfField != null) {
966             oneOfViolation(existingOneOfField, "invalidation");
967           }
968           existingOneOfField = "invalidation";
969         }
970         if (hasInvalidateAll()) {
971           if (existingOneOfField != null) {
972             oneOfViolation(existingOneOfField, "invalidate_all");
973           }
974           existingOneOfField = "invalidate_all";
975         }
976         if (existingOneOfField == null) { oneOfViolation(); }
977       }
978
979       public Bytes getAckHandle() { return ackHandle; }
980
981       public com.google.ipc.invalidation.ticl.proto.ClientProtocol.InvalidationP getNullableInvalidation() { return invalidation; }
982
983       public com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP getNullableInvalidateUnknown() { return invalidateUnknown; }
984
985       public boolean getInvalidateAll() { return invalidateAll; }
986       public boolean hasInvalidateAll() { return (0x1 & __hazzerBits) != 0; }
987
988       @Override public final boolean equals(Object obj) {
989         if (this == obj) { return true; }
990         if (!(obj instanceof InvalidateUpcall)) { return false; }
991         InvalidateUpcall other = (InvalidateUpcall) obj;
992         return __hazzerBits == other.__hazzerBits
993             && equals(ackHandle, other.ackHandle)
994             && equals(invalidation, other.invalidation)
995             && equals(invalidateUnknown, other.invalidateUnknown)
996             && (!hasInvalidateAll() || invalidateAll == other.invalidateAll);
997       }
998
999       @Override protected int computeHashCode() {
1000         int result = hash(__hazzerBits);
1001         result = result * 31 + ackHandle.hashCode();
1002         if (invalidation != null) {
1003           result = result * 31 + invalidation.hashCode();
1004         }
1005         if (invalidateUnknown != null) {
1006           result = result * 31 + invalidateUnknown.hashCode();
1007         }
1008         if (hasInvalidateAll()) {
1009           result = result * 31 + hash(invalidateAll);
1010         }
1011         return result;
1012       }
1013
1014       @Override public void toCompactString(TextBuilder builder) {
1015         builder.append("<InvalidateUpcall:");
1016         builder.append(" ack_handle=").append(ackHandle);
1017         if (invalidation != null) {
1018           builder.append(" invalidation=").append(invalidation);
1019         }
1020         if (invalidateUnknown != null) {
1021           builder.append(" invalidate_unknown=").append(invalidateUnknown);
1022         }
1023         if (hasInvalidateAll()) {
1024           builder.append(" invalidate_all=").append(invalidateAll);
1025         }
1026         builder.append('>');
1027       }
1028
1029       public static InvalidateUpcall parseFrom(byte[] data) throws ValidationException {
1030         try {
1031           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.InvalidateUpcall(), data));
1032         } catch (InvalidProtocolBufferNanoException exception) {
1033           throw new ValidationException(exception);
1034         } catch (ValidationArgumentException exception) {
1035           throw new ValidationException(exception.getMessage());
1036         }
1037       }
1038
1039       static InvalidateUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.InvalidateUpcall message) {
1040         if (message == null) { return null; }
1041         return new InvalidateUpcall(Bytes.fromByteArray(message.ackHandle),
1042             com.google.ipc.invalidation.ticl.proto.ClientProtocol.InvalidationP.fromMessageNano(message.invalidation),
1043             com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP.fromMessageNano(message.invalidateUnknown),
1044             message.invalidateAll);
1045       }
1046
1047       public byte[] toByteArray() {
1048         return MessageNano.toByteArray(toMessageNano());
1049       }
1050
1051       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.InvalidateUpcall toMessageNano() {
1052         com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.InvalidateUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.InvalidateUpcall();
1053         msg.ackHandle = ackHandle.getByteArray();
1054         msg.invalidation = this.invalidation != null ? invalidation.toMessageNano() : null;
1055         msg.invalidateUnknown = this.invalidateUnknown != null ? invalidateUnknown.toMessageNano() : null;
1056         msg.invalidateAll = hasInvalidateAll() ? invalidateAll : null;
1057         return msg;
1058       }
1059     }
1060     public static final class RegistrationStatusUpcall extends ProtoWrapper {
1061       public static RegistrationStatusUpcall create(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP objectId,
1062           boolean isRegistered) {
1063         return new RegistrationStatusUpcall(objectId, isRegistered);
1064       }
1065
1066       private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP objectId;
1067       private final boolean isRegistered;
1068
1069       private RegistrationStatusUpcall(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP objectId,
1070           Boolean isRegistered) throws ValidationArgumentException {
1071         required("object_id", objectId);
1072         this.objectId = objectId;
1073         required("is_registered", isRegistered);
1074         this.isRegistered = isRegistered;
1075       }
1076
1077       public com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP getObjectId() { return objectId; }
1078
1079       public boolean getIsRegistered() { return isRegistered; }
1080
1081       @Override public final boolean equals(Object obj) {
1082         if (this == obj) { return true; }
1083         if (!(obj instanceof RegistrationStatusUpcall)) { return false; }
1084         RegistrationStatusUpcall other = (RegistrationStatusUpcall) obj;
1085         return equals(objectId, other.objectId)
1086             && isRegistered == other.isRegistered;
1087       }
1088
1089       @Override protected int computeHashCode() {
1090         int result = 1;
1091         result = result * 31 + objectId.hashCode();
1092         result = result * 31 + hash(isRegistered);
1093         return result;
1094       }
1095
1096       @Override public void toCompactString(TextBuilder builder) {
1097         builder.append("<RegistrationStatusUpcall:");
1098         builder.append(" object_id=").append(objectId);
1099         builder.append(" is_registered=").append(isRegistered);
1100         builder.append('>');
1101       }
1102
1103       public static RegistrationStatusUpcall parseFrom(byte[] data) throws ValidationException {
1104         try {
1105           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationStatusUpcall(), data));
1106         } catch (InvalidProtocolBufferNanoException exception) {
1107           throw new ValidationException(exception);
1108         } catch (ValidationArgumentException exception) {
1109           throw new ValidationException(exception.getMessage());
1110         }
1111       }
1112
1113       static RegistrationStatusUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationStatusUpcall message) {
1114         if (message == null) { return null; }
1115         return new RegistrationStatusUpcall(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP.fromMessageNano(message.objectId),
1116             message.isRegistered);
1117       }
1118
1119       public byte[] toByteArray() {
1120         return MessageNano.toByteArray(toMessageNano());
1121       }
1122
1123       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationStatusUpcall toMessageNano() {
1124         com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationStatusUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationStatusUpcall();
1125         msg.objectId = objectId.toMessageNano();
1126         msg.isRegistered = isRegistered;
1127         return msg;
1128       }
1129     }
1130     public static final class RegistrationFailureUpcall extends ProtoWrapper {
1131       public static RegistrationFailureUpcall create(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP objectId,
1132           boolean transient_,
1133           String message) {
1134         return new RegistrationFailureUpcall(objectId, transient_, message);
1135       }
1136
1137       private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP objectId;
1138       private final boolean transient_;
1139       private final String message;
1140
1141       private RegistrationFailureUpcall(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP objectId,
1142           Boolean transient_,
1143           String message) throws ValidationArgumentException {
1144         required("object_id", objectId);
1145         this.objectId = objectId;
1146         required("transient", transient_);
1147         this.transient_ = transient_;
1148         required("message", message);
1149         this.message = message;
1150       }
1151
1152       public com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP getObjectId() { return objectId; }
1153
1154       public boolean getTransient() { return transient_; }
1155
1156       public String getMessage() { return message; }
1157
1158       @Override public final boolean equals(Object obj) {
1159         if (this == obj) { return true; }
1160         if (!(obj instanceof RegistrationFailureUpcall)) { return false; }
1161         RegistrationFailureUpcall other = (RegistrationFailureUpcall) obj;
1162         return equals(objectId, other.objectId)
1163             && transient_ == other.transient_
1164             && equals(message, other.message);
1165       }
1166
1167       @Override protected int computeHashCode() {
1168         int result = 1;
1169         result = result * 31 + objectId.hashCode();
1170         result = result * 31 + hash(transient_);
1171         result = result * 31 + message.hashCode();
1172         return result;
1173       }
1174
1175       @Override public void toCompactString(TextBuilder builder) {
1176         builder.append("<RegistrationFailureUpcall:");
1177         builder.append(" object_id=").append(objectId);
1178         builder.append(" transient=").append(transient_);
1179         builder.append(" message=").append(message);
1180         builder.append('>');
1181       }
1182
1183       public static RegistrationFailureUpcall parseFrom(byte[] data) throws ValidationException {
1184         try {
1185           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationFailureUpcall(), data));
1186         } catch (InvalidProtocolBufferNanoException exception) {
1187           throw new ValidationException(exception);
1188         } catch (ValidationArgumentException exception) {
1189           throw new ValidationException(exception.getMessage());
1190         }
1191       }
1192
1193       static RegistrationFailureUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationFailureUpcall message) {
1194         if (message == null) { return null; }
1195         return new RegistrationFailureUpcall(com.google.ipc.invalidation.ticl.proto.ClientProtocol.ObjectIdP.fromMessageNano(message.objectId),
1196             message.transient_,
1197             message.message);
1198       }
1199
1200       public byte[] toByteArray() {
1201         return MessageNano.toByteArray(toMessageNano());
1202       }
1203
1204       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationFailureUpcall toMessageNano() {
1205         com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationFailureUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.RegistrationFailureUpcall();
1206         msg.objectId = objectId.toMessageNano();
1207         msg.transient_ = transient_;
1208         msg.message = message;
1209         return msg;
1210       }
1211     }
1212     public static final class ReissueRegistrationsUpcall extends ProtoWrapper {
1213       public static ReissueRegistrationsUpcall create(Bytes prefix,
1214           int length) {
1215         return new ReissueRegistrationsUpcall(prefix, length);
1216       }
1217
1218       private final Bytes prefix;
1219       private final int length;
1220
1221       private ReissueRegistrationsUpcall(Bytes prefix,
1222           Integer length) throws ValidationArgumentException {
1223         required("prefix", prefix);
1224         this.prefix = prefix;
1225         required("length", length);
1226         this.length = length;
1227       }
1228
1229       public Bytes getPrefix() { return prefix; }
1230
1231       public int getLength() { return length; }
1232
1233       @Override public final boolean equals(Object obj) {
1234         if (this == obj) { return true; }
1235         if (!(obj instanceof ReissueRegistrationsUpcall)) { return false; }
1236         ReissueRegistrationsUpcall other = (ReissueRegistrationsUpcall) obj;
1237         return equals(prefix, other.prefix)
1238             && length == other.length;
1239       }
1240
1241       @Override protected int computeHashCode() {
1242         int result = 1;
1243         result = result * 31 + prefix.hashCode();
1244         result = result * 31 + hash(length);
1245         return result;
1246       }
1247
1248       @Override public void toCompactString(TextBuilder builder) {
1249         builder.append("<ReissueRegistrationsUpcall:");
1250         builder.append(" prefix=").append(prefix);
1251         builder.append(" length=").append(length);
1252         builder.append('>');
1253       }
1254
1255       public static ReissueRegistrationsUpcall parseFrom(byte[] data) throws ValidationException {
1256         try {
1257           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReissueRegistrationsUpcall(), data));
1258         } catch (InvalidProtocolBufferNanoException exception) {
1259           throw new ValidationException(exception);
1260         } catch (ValidationArgumentException exception) {
1261           throw new ValidationException(exception.getMessage());
1262         }
1263       }
1264
1265       static ReissueRegistrationsUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReissueRegistrationsUpcall message) {
1266         if (message == null) { return null; }
1267         return new ReissueRegistrationsUpcall(Bytes.fromByteArray(message.prefix),
1268             message.length);
1269       }
1270
1271       public byte[] toByteArray() {
1272         return MessageNano.toByteArray(toMessageNano());
1273       }
1274
1275       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReissueRegistrationsUpcall toMessageNano() {
1276         com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReissueRegistrationsUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ReissueRegistrationsUpcall();
1277         msg.prefix = prefix.getByteArray();
1278         msg.length = length;
1279         return msg;
1280       }
1281     }
1282     public static final class ErrorUpcall extends ProtoWrapper {
1283       public static ErrorUpcall create(int errorCode,
1284           String errorMessage,
1285           boolean isTransient) {
1286         return new ErrorUpcall(errorCode, errorMessage, isTransient);
1287       }
1288
1289       private final int errorCode;
1290       private final String errorMessage;
1291       private final boolean isTransient;
1292
1293       private ErrorUpcall(Integer errorCode,
1294           String errorMessage,
1295           Boolean isTransient) throws ValidationArgumentException {
1296         required("error_code", errorCode);
1297         this.errorCode = errorCode;
1298         required("error_message", errorMessage);
1299         this.errorMessage = errorMessage;
1300         required("is_transient", isTransient);
1301         this.isTransient = isTransient;
1302       }
1303
1304       public int getErrorCode() { return errorCode; }
1305
1306       public String getErrorMessage() { return errorMessage; }
1307
1308       public boolean getIsTransient() { return isTransient; }
1309
1310       @Override public final boolean equals(Object obj) {
1311         if (this == obj) { return true; }
1312         if (!(obj instanceof ErrorUpcall)) { return false; }
1313         ErrorUpcall other = (ErrorUpcall) obj;
1314         return errorCode == other.errorCode
1315             && equals(errorMessage, other.errorMessage)
1316             && isTransient == other.isTransient;
1317       }
1318
1319       @Override protected int computeHashCode() {
1320         int result = 1;
1321         result = result * 31 + hash(errorCode);
1322         result = result * 31 + errorMessage.hashCode();
1323         result = result * 31 + hash(isTransient);
1324         return result;
1325       }
1326
1327       @Override public void toCompactString(TextBuilder builder) {
1328         builder.append("<ErrorUpcall:");
1329         builder.append(" error_code=").append(errorCode);
1330         builder.append(" error_message=").append(errorMessage);
1331         builder.append(" is_transient=").append(isTransient);
1332         builder.append('>');
1333       }
1334
1335       public static ErrorUpcall parseFrom(byte[] data) throws ValidationException {
1336         try {
1337           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ErrorUpcall(), data));
1338         } catch (InvalidProtocolBufferNanoException exception) {
1339           throw new ValidationException(exception);
1340         } catch (ValidationArgumentException exception) {
1341           throw new ValidationException(exception.getMessage());
1342         }
1343       }
1344
1345       static ErrorUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ErrorUpcall message) {
1346         if (message == null) { return null; }
1347         return new ErrorUpcall(message.errorCode,
1348             message.errorMessage,
1349             message.isTransient);
1350       }
1351
1352       public byte[] toByteArray() {
1353         return MessageNano.toByteArray(toMessageNano());
1354       }
1355
1356       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ErrorUpcall toMessageNano() {
1357         com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ErrorUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall.ErrorUpcall();
1358         msg.errorCode = errorCode;
1359         msg.errorMessage = errorMessage;
1360         msg.isTransient = isTransient;
1361         return msg;
1362       }
1363     }
1364     public static ListenerUpcall createWithSerial(long serial,
1365         com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version) {
1366       return new ListenerUpcall(serial, version, null, null, null, null, null, null);
1367     }
1368
1369     public static ListenerUpcall createWithReady(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1370         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReadyUpcall ready) {
1371       return new ListenerUpcall(null, version, ready, null, null, null, null, null);
1372     }
1373
1374     public static ListenerUpcall createWithInvalidate(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1375         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.InvalidateUpcall invalidate) {
1376       return new ListenerUpcall(null, version, null, invalidate, null, null, null, null);
1377     }
1378
1379     public static ListenerUpcall createWithRegistrationStatus(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1380         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationStatusUpcall registrationStatus) {
1381       return new ListenerUpcall(null, version, null, null, registrationStatus, null, null, null);
1382     }
1383
1384     public static ListenerUpcall createWithRegistrationFailure(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1385         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationFailureUpcall registrationFailure) {
1386       return new ListenerUpcall(null, version, null, null, null, registrationFailure, null, null);
1387     }
1388
1389     public static ListenerUpcall createWithReissueRegistrations(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1390         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReissueRegistrationsUpcall reissueRegistrations) {
1391       return new ListenerUpcall(null, version, null, null, null, null, reissueRegistrations, null);
1392     }
1393
1394     public static ListenerUpcall createWithError(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1395         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ErrorUpcall error) {
1396       return new ListenerUpcall(null, version, null, null, null, null, null, error);
1397     }
1398
1399     private final long __hazzerBits;
1400     private final long serial;
1401     private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version;
1402     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReadyUpcall ready;
1403     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.InvalidateUpcall invalidate;
1404     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationStatusUpcall registrationStatus;
1405     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationFailureUpcall registrationFailure;
1406     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReissueRegistrationsUpcall reissueRegistrations;
1407     private final com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ErrorUpcall error;
1408
1409     private ListenerUpcall(Long serial,
1410         com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1411         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReadyUpcall ready,
1412         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.InvalidateUpcall invalidate,
1413         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationStatusUpcall registrationStatus,
1414         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationFailureUpcall registrationFailure,
1415         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReissueRegistrationsUpcall reissueRegistrations,
1416         com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ErrorUpcall error) throws ValidationArgumentException {
1417       int hazzerBits = 0;
1418       if (serial != null) {
1419         hazzerBits |= 0x1;
1420         this.serial = serial;
1421       } else {
1422         this.serial = 0;
1423       }
1424       required("version", version);
1425       this.version = version;
1426       if (ready != null) {
1427         hazzerBits |= 0x2;
1428         this.ready = ready;
1429       } else {
1430         this.ready = com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReadyUpcall.DEFAULT_INSTANCE;
1431       }
1432       this.invalidate = invalidate;
1433       this.registrationStatus = registrationStatus;
1434       this.registrationFailure = registrationFailure;
1435       this.reissueRegistrations = reissueRegistrations;
1436       this.error = error;
1437       this.__hazzerBits = hazzerBits;
1438       String existingOneOfField = null;
1439       if (this.reissueRegistrations != null) {
1440         existingOneOfField = "reissue_registrations";
1441       }
1442       if (hasSerial()) {
1443         if (existingOneOfField != null) {
1444           oneOfViolation(existingOneOfField, "serial");
1445         }
1446         existingOneOfField = "serial";
1447       }
1448       if (this.registrationFailure != null) {
1449         if (existingOneOfField != null) {
1450           oneOfViolation(existingOneOfField, "registration_failure");
1451         }
1452         existingOneOfField = "registration_failure";
1453       }
1454       if (hasReady()) {
1455         if (existingOneOfField != null) {
1456           oneOfViolation(existingOneOfField, "ready");
1457         }
1458         existingOneOfField = "ready";
1459       }
1460       if (this.invalidate != null) {
1461         if (existingOneOfField != null) {
1462           oneOfViolation(existingOneOfField, "invalidate");
1463         }
1464         existingOneOfField = "invalidate";
1465       }
1466       if (this.registrationStatus != null) {
1467         if (existingOneOfField != null) {
1468           oneOfViolation(existingOneOfField, "registration_status");
1469         }
1470         existingOneOfField = "registration_status";
1471       }
1472       if (this.error != null) {
1473         if (existingOneOfField != null) {
1474           oneOfViolation(existingOneOfField, "error");
1475         }
1476         existingOneOfField = "error";
1477       }
1478       if (existingOneOfField == null) { oneOfViolation(); }
1479     }
1480
1481     public long getSerial() { return serial; }
1482     public boolean hasSerial() { return (0x1 & __hazzerBits) != 0; }
1483
1484     public com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version getVersion() { return version; }
1485
1486     public com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReadyUpcall getReady() { return ready; }
1487     public boolean hasReady() { return (0x2 & __hazzerBits) != 0; }
1488
1489     public com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.InvalidateUpcall getNullableInvalidate() { return invalidate; }
1490
1491     public com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationStatusUpcall getNullableRegistrationStatus() { return registrationStatus; }
1492
1493     public com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationFailureUpcall getNullableRegistrationFailure() { return registrationFailure; }
1494
1495     public com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReissueRegistrationsUpcall getNullableReissueRegistrations() { return reissueRegistrations; }
1496
1497     public com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ErrorUpcall getNullableError() { return error; }
1498
1499     @Override public final boolean equals(Object obj) {
1500       if (this == obj) { return true; }
1501       if (!(obj instanceof ListenerUpcall)) { return false; }
1502       ListenerUpcall other = (ListenerUpcall) obj;
1503       return __hazzerBits == other.__hazzerBits
1504           && (!hasSerial() || serial == other.serial)
1505           && equals(version, other.version)
1506           && (!hasReady() || equals(ready, other.ready))
1507           && equals(invalidate, other.invalidate)
1508           && equals(registrationStatus, other.registrationStatus)
1509           && equals(registrationFailure, other.registrationFailure)
1510           && equals(reissueRegistrations, other.reissueRegistrations)
1511           && equals(error, other.error);
1512     }
1513
1514     @Override protected int computeHashCode() {
1515       int result = hash(__hazzerBits);
1516       if (hasSerial()) {
1517         result = result * 31 + hash(serial);
1518       }
1519       result = result * 31 + version.hashCode();
1520       if (hasReady()) {
1521         result = result * 31 + ready.hashCode();
1522       }
1523       if (invalidate != null) {
1524         result = result * 31 + invalidate.hashCode();
1525       }
1526       if (registrationStatus != null) {
1527         result = result * 31 + registrationStatus.hashCode();
1528       }
1529       if (registrationFailure != null) {
1530         result = result * 31 + registrationFailure.hashCode();
1531       }
1532       if (reissueRegistrations != null) {
1533         result = result * 31 + reissueRegistrations.hashCode();
1534       }
1535       if (error != null) {
1536         result = result * 31 + error.hashCode();
1537       }
1538       return result;
1539     }
1540
1541     @Override public void toCompactString(TextBuilder builder) {
1542       builder.append("<ListenerUpcall:");
1543       if (hasSerial()) {
1544         builder.append(" serial=").append(serial);
1545       }
1546       builder.append(" version=").append(version);
1547       if (hasReady()) {
1548         builder.append(" ready=").append(ready);
1549       }
1550       if (invalidate != null) {
1551         builder.append(" invalidate=").append(invalidate);
1552       }
1553       if (registrationStatus != null) {
1554         builder.append(" registration_status=").append(registrationStatus);
1555       }
1556       if (registrationFailure != null) {
1557         builder.append(" registration_failure=").append(registrationFailure);
1558       }
1559       if (reissueRegistrations != null) {
1560         builder.append(" reissue_registrations=").append(reissueRegistrations);
1561       }
1562       if (error != null) {
1563         builder.append(" error=").append(error);
1564       }
1565       builder.append('>');
1566     }
1567
1568     public static ListenerUpcall parseFrom(byte[] data) throws ValidationException {
1569       try {
1570         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall(), data));
1571       } catch (InvalidProtocolBufferNanoException exception) {
1572         throw new ValidationException(exception);
1573       } catch (ValidationArgumentException exception) {
1574         throw new ValidationException(exception.getMessage());
1575       }
1576     }
1577
1578     static ListenerUpcall fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall message) {
1579       if (message == null) { return null; }
1580       return new ListenerUpcall(message.serial,
1581           com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version.fromMessageNano(message.version),
1582           com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReadyUpcall.fromMessageNano(message.ready),
1583           com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.InvalidateUpcall.fromMessageNano(message.invalidate),
1584           com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationStatusUpcall.fromMessageNano(message.registrationStatus),
1585           com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.RegistrationFailureUpcall.fromMessageNano(message.registrationFailure),
1586           com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ReissueRegistrationsUpcall.fromMessageNano(message.reissueRegistrations),
1587           com.google.ipc.invalidation.ticl.proto.AndroidService.ListenerUpcall.ErrorUpcall.fromMessageNano(message.error));
1588     }
1589
1590     public byte[] toByteArray() {
1591       return MessageNano.toByteArray(toMessageNano());
1592     }
1593
1594     com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall toMessageNano() {
1595       com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall msg = new com.google.protos.ipc.invalidation.NanoAndroidService.ListenerUpcall();
1596       msg.serial = hasSerial() ? serial : null;
1597       msg.version = version.toMessageNano();
1598       msg.ready = hasReady() ? ready.toMessageNano() : null;
1599       msg.invalidate = this.invalidate != null ? invalidate.toMessageNano() : null;
1600       msg.registrationStatus = this.registrationStatus != null ? registrationStatus.toMessageNano() : null;
1601       msg.registrationFailure = this.registrationFailure != null ? registrationFailure.toMessageNano() : null;
1602       msg.reissueRegistrations = this.reissueRegistrations != null ? reissueRegistrations.toMessageNano() : null;
1603       msg.error = this.error != null ? error.toMessageNano() : null;
1604       return msg;
1605     }
1606   }
1607
1608   public static final class AndroidSchedulerEvent extends ProtoWrapper {
1609     public static AndroidSchedulerEvent create(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1610         String eventName,
1611         long ticlId) {
1612       return new AndroidSchedulerEvent(version, eventName, ticlId);
1613     }
1614
1615     private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version;
1616     private final String eventName;
1617     private final long ticlId;
1618
1619     private AndroidSchedulerEvent(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1620         String eventName,
1621         Long ticlId) throws ValidationArgumentException {
1622       required("version", version);
1623       this.version = version;
1624       required("event_name", eventName);
1625       this.eventName = eventName;
1626       required("ticl_id", ticlId);
1627       this.ticlId = ticlId;
1628     }
1629
1630     public com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version getVersion() { return version; }
1631
1632     public String getEventName() { return eventName; }
1633
1634     public long getTiclId() { return ticlId; }
1635
1636     @Override public final boolean equals(Object obj) {
1637       if (this == obj) { return true; }
1638       if (!(obj instanceof AndroidSchedulerEvent)) { return false; }
1639       AndroidSchedulerEvent other = (AndroidSchedulerEvent) obj;
1640       return equals(version, other.version)
1641           && equals(eventName, other.eventName)
1642           && ticlId == other.ticlId;
1643     }
1644
1645     @Override protected int computeHashCode() {
1646       int result = 1;
1647       result = result * 31 + version.hashCode();
1648       result = result * 31 + eventName.hashCode();
1649       result = result * 31 + hash(ticlId);
1650       return result;
1651     }
1652
1653     @Override public void toCompactString(TextBuilder builder) {
1654       builder.append("<AndroidSchedulerEvent:");
1655       builder.append(" version=").append(version);
1656       builder.append(" event_name=").append(eventName);
1657       builder.append(" ticl_id=").append(ticlId);
1658       builder.append('>');
1659     }
1660
1661     public static AndroidSchedulerEvent parseFrom(byte[] data) throws ValidationException {
1662       try {
1663         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidSchedulerEvent(), data));
1664       } catch (InvalidProtocolBufferNanoException exception) {
1665         throw new ValidationException(exception);
1666       } catch (ValidationArgumentException exception) {
1667         throw new ValidationException(exception.getMessage());
1668       }
1669     }
1670
1671     static AndroidSchedulerEvent fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.AndroidSchedulerEvent message) {
1672       if (message == null) { return null; }
1673       return new AndroidSchedulerEvent(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version.fromMessageNano(message.version),
1674           message.eventName,
1675           message.ticlId);
1676     }
1677
1678     public byte[] toByteArray() {
1679       return MessageNano.toByteArray(toMessageNano());
1680     }
1681
1682     com.google.protos.ipc.invalidation.NanoAndroidService.AndroidSchedulerEvent toMessageNano() {
1683       com.google.protos.ipc.invalidation.NanoAndroidService.AndroidSchedulerEvent msg = new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidSchedulerEvent();
1684       msg.version = version.toMessageNano();
1685       msg.eventName = eventName;
1686       msg.ticlId = ticlId;
1687       return msg;
1688     }
1689   }
1690
1691   public static final class AndroidNetworkSendRequest extends ProtoWrapper {
1692     public static AndroidNetworkSendRequest create(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1693         Bytes message) {
1694       return new AndroidNetworkSendRequest(version, message);
1695     }
1696
1697     private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version;
1698     private final Bytes message;
1699
1700     private AndroidNetworkSendRequest(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1701         Bytes message) throws ValidationArgumentException {
1702       required("version", version);
1703       this.version = version;
1704       required("message", message);
1705       this.message = message;
1706     }
1707
1708     public com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version getVersion() { return version; }
1709
1710     public Bytes getMessage() { return message; }
1711
1712     @Override public final boolean equals(Object obj) {
1713       if (this == obj) { return true; }
1714       if (!(obj instanceof AndroidNetworkSendRequest)) { return false; }
1715       AndroidNetworkSendRequest other = (AndroidNetworkSendRequest) obj;
1716       return equals(version, other.version)
1717           && equals(message, other.message);
1718     }
1719
1720     @Override protected int computeHashCode() {
1721       int result = 1;
1722       result = result * 31 + version.hashCode();
1723       result = result * 31 + message.hashCode();
1724       return result;
1725     }
1726
1727     @Override public void toCompactString(TextBuilder builder) {
1728       builder.append("<AndroidNetworkSendRequest:");
1729       builder.append(" version=").append(version);
1730       builder.append(" message=").append(message);
1731       builder.append('>');
1732     }
1733
1734     public static AndroidNetworkSendRequest parseFrom(byte[] data) throws ValidationException {
1735       try {
1736         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidNetworkSendRequest(), data));
1737       } catch (InvalidProtocolBufferNanoException exception) {
1738         throw new ValidationException(exception);
1739       } catch (ValidationArgumentException exception) {
1740         throw new ValidationException(exception.getMessage());
1741       }
1742     }
1743
1744     static AndroidNetworkSendRequest fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.AndroidNetworkSendRequest message) {
1745       if (message == null) { return null; }
1746       return new AndroidNetworkSendRequest(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version.fromMessageNano(message.version),
1747           Bytes.fromByteArray(message.message));
1748     }
1749
1750     public byte[] toByteArray() {
1751       return MessageNano.toByteArray(toMessageNano());
1752     }
1753
1754     com.google.protos.ipc.invalidation.NanoAndroidService.AndroidNetworkSendRequest toMessageNano() {
1755       com.google.protos.ipc.invalidation.NanoAndroidService.AndroidNetworkSendRequest msg = new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidNetworkSendRequest();
1756       msg.version = version.toMessageNano();
1757       msg.message = message.getByteArray();
1758       return msg;
1759     }
1760   }
1761
1762   public static final class AndroidTiclState extends ProtoWrapper {
1763     public static final class Metadata extends ProtoWrapper {
1764       public static Metadata create(int clientType,
1765           Bytes clientName,
1766           long ticlId,
1767           com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP clientConfig) {
1768         return new Metadata(clientType, clientName, ticlId, clientConfig);
1769       }
1770
1771       private final int clientType;
1772       private final Bytes clientName;
1773       private final long ticlId;
1774       private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP clientConfig;
1775
1776       private Metadata(Integer clientType,
1777           Bytes clientName,
1778           Long ticlId,
1779           com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP clientConfig) throws ValidationArgumentException {
1780         required("client_type", clientType);
1781         this.clientType = clientType;
1782         required("client_name", clientName);
1783         this.clientName = clientName;
1784         required("ticl_id", ticlId);
1785         this.ticlId = ticlId;
1786         required("client_config", clientConfig);
1787         this.clientConfig = clientConfig;
1788       }
1789
1790       public int getClientType() { return clientType; }
1791
1792       public Bytes getClientName() { return clientName; }
1793
1794       public long getTiclId() { return ticlId; }
1795
1796       public com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP getClientConfig() { return clientConfig; }
1797
1798       @Override public final boolean equals(Object obj) {
1799         if (this == obj) { return true; }
1800         if (!(obj instanceof Metadata)) { return false; }
1801         Metadata other = (Metadata) obj;
1802         return clientType == other.clientType
1803             && equals(clientName, other.clientName)
1804             && ticlId == other.ticlId
1805             && equals(clientConfig, other.clientConfig);
1806       }
1807
1808       @Override protected int computeHashCode() {
1809         int result = 1;
1810         result = result * 31 + hash(clientType);
1811         result = result * 31 + clientName.hashCode();
1812         result = result * 31 + hash(ticlId);
1813         result = result * 31 + clientConfig.hashCode();
1814         return result;
1815       }
1816
1817       @Override public void toCompactString(TextBuilder builder) {
1818         builder.append("<Metadata:");
1819         builder.append(" client_type=").append(clientType);
1820         builder.append(" client_name=").append(clientName);
1821         builder.append(" ticl_id=").append(ticlId);
1822         builder.append(" client_config=").append(clientConfig);
1823         builder.append('>');
1824       }
1825
1826       public static Metadata parseFrom(byte[] data) throws ValidationException {
1827         try {
1828           return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState.Metadata(), data));
1829         } catch (InvalidProtocolBufferNanoException exception) {
1830           throw new ValidationException(exception);
1831         } catch (ValidationArgumentException exception) {
1832           throw new ValidationException(exception.getMessage());
1833         }
1834       }
1835
1836       static Metadata fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState.Metadata message) {
1837         if (message == null) { return null; }
1838         return new Metadata(message.clientType,
1839             Bytes.fromByteArray(message.clientName),
1840             message.ticlId,
1841             com.google.ipc.invalidation.ticl.proto.ClientProtocol.ClientConfigP.fromMessageNano(message.clientConfig));
1842       }
1843
1844       public byte[] toByteArray() {
1845         return MessageNano.toByteArray(toMessageNano());
1846       }
1847
1848       com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState.Metadata toMessageNano() {
1849         com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState.Metadata msg = new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState.Metadata();
1850         msg.clientType = clientType;
1851         msg.clientName = clientName.getByteArray();
1852         msg.ticlId = ticlId;
1853         msg.clientConfig = clientConfig.toMessageNano();
1854         return msg;
1855       }
1856     }
1857     public static AndroidTiclState create(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1858         com.google.ipc.invalidation.ticl.proto.JavaClient.InvalidationClientState ticlState,
1859         com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState.Metadata metadata) {
1860       return new AndroidTiclState(version, ticlState, metadata);
1861     }
1862
1863     private final com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version;
1864     private final com.google.ipc.invalidation.ticl.proto.JavaClient.InvalidationClientState ticlState;
1865     private final com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState.Metadata metadata;
1866
1867     private AndroidTiclState(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version version,
1868         com.google.ipc.invalidation.ticl.proto.JavaClient.InvalidationClientState ticlState,
1869         com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState.Metadata metadata) throws ValidationArgumentException {
1870       required("version", version);
1871       this.version = version;
1872       required("ticl_state", ticlState);
1873       this.ticlState = ticlState;
1874       required("metadata", metadata);
1875       this.metadata = metadata;
1876     }
1877
1878     public com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version getVersion() { return version; }
1879
1880     public com.google.ipc.invalidation.ticl.proto.JavaClient.InvalidationClientState getTiclState() { return ticlState; }
1881
1882     public com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState.Metadata getMetadata() { return metadata; }
1883
1884     @Override public final boolean equals(Object obj) {
1885       if (this == obj) { return true; }
1886       if (!(obj instanceof AndroidTiclState)) { return false; }
1887       AndroidTiclState other = (AndroidTiclState) obj;
1888       return equals(version, other.version)
1889           && equals(ticlState, other.ticlState)
1890           && equals(metadata, other.metadata);
1891     }
1892
1893     @Override protected int computeHashCode() {
1894       int result = 1;
1895       result = result * 31 + version.hashCode();
1896       result = result * 31 + ticlState.hashCode();
1897       result = result * 31 + metadata.hashCode();
1898       return result;
1899     }
1900
1901     @Override public void toCompactString(TextBuilder builder) {
1902       builder.append("<AndroidTiclState:");
1903       builder.append(" version=").append(version);
1904       builder.append(" ticl_state=").append(ticlState);
1905       builder.append(" metadata=").append(metadata);
1906       builder.append('>');
1907     }
1908
1909     public static AndroidTiclState parseFrom(byte[] data) throws ValidationException {
1910       try {
1911         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState(), data));
1912       } catch (InvalidProtocolBufferNanoException exception) {
1913         throw new ValidationException(exception);
1914       } catch (ValidationArgumentException exception) {
1915         throw new ValidationException(exception.getMessage());
1916       }
1917     }
1918
1919     static AndroidTiclState fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState message) {
1920       if (message == null) { return null; }
1921       return new AndroidTiclState(com.google.ipc.invalidation.ticl.proto.ClientProtocol.Version.fromMessageNano(message.version),
1922           com.google.ipc.invalidation.ticl.proto.JavaClient.InvalidationClientState.fromMessageNano(message.ticlState),
1923           com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState.Metadata.fromMessageNano(message.metadata));
1924     }
1925
1926     public byte[] toByteArray() {
1927       return MessageNano.toByteArray(toMessageNano());
1928     }
1929
1930     com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState toMessageNano() {
1931       com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState msg = new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclState();
1932       msg.version = version.toMessageNano();
1933       msg.ticlState = ticlState.toMessageNano();
1934       msg.metadata = metadata.toMessageNano();
1935       return msg;
1936     }
1937   }
1938
1939   public static final class AndroidTiclStateWithDigest extends ProtoWrapper {
1940     public static AndroidTiclStateWithDigest create(com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState state,
1941         Bytes digest) {
1942       return new AndroidTiclStateWithDigest(state, digest);
1943     }
1944
1945     private final com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState state;
1946     private final Bytes digest;
1947
1948     private AndroidTiclStateWithDigest(com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState state,
1949         Bytes digest) throws ValidationArgumentException {
1950       required("state", state);
1951       this.state = state;
1952       required("digest", digest);
1953       this.digest = digest;
1954     }
1955
1956     public com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState getState() { return state; }
1957
1958     public Bytes getDigest() { return digest; }
1959
1960     @Override public final boolean equals(Object obj) {
1961       if (this == obj) { return true; }
1962       if (!(obj instanceof AndroidTiclStateWithDigest)) { return false; }
1963       AndroidTiclStateWithDigest other = (AndroidTiclStateWithDigest) obj;
1964       return equals(state, other.state)
1965           && equals(digest, other.digest);
1966     }
1967
1968     @Override protected int computeHashCode() {
1969       int result = 1;
1970       result = result * 31 + state.hashCode();
1971       result = result * 31 + digest.hashCode();
1972       return result;
1973     }
1974
1975     @Override public void toCompactString(TextBuilder builder) {
1976       builder.append("<AndroidTiclStateWithDigest:");
1977       builder.append(" state=").append(state);
1978       builder.append(" digest=").append(digest);
1979       builder.append('>');
1980     }
1981
1982     public static AndroidTiclStateWithDigest parseFrom(byte[] data) throws ValidationException {
1983       try {
1984         return fromMessageNano(MessageNano.mergeFrom(new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclStateWithDigest(), data));
1985       } catch (InvalidProtocolBufferNanoException exception) {
1986         throw new ValidationException(exception);
1987       } catch (ValidationArgumentException exception) {
1988         throw new ValidationException(exception.getMessage());
1989       }
1990     }
1991
1992     static AndroidTiclStateWithDigest fromMessageNano(com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclStateWithDigest message) {
1993       if (message == null) { return null; }
1994       return new AndroidTiclStateWithDigest(com.google.ipc.invalidation.ticl.proto.AndroidService.AndroidTiclState.fromMessageNano(message.state),
1995           Bytes.fromByteArray(message.digest));
1996     }
1997
1998     public byte[] toByteArray() {
1999       return MessageNano.toByteArray(toMessageNano());
2000     }
2001
2002     com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclStateWithDigest toMessageNano() {
2003       com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclStateWithDigest msg = new com.google.protos.ipc.invalidation.NanoAndroidService.AndroidTiclStateWithDigest();
2004       msg.state = state.toMessageNano();
2005       msg.digest = digest.getByteArray();
2006       return msg;
2007     }
2008   }
2009 }