001 //
002 // Generated by protoc, do not edit by hand.
003 //
004 package protobuf_unittest;
005
006 public class UnittestMset {
007
008 static public final class TestMessageSet extends TestMessageSetBase<TestMessageSet> {
009
010 public java.util.ArrayList<String> missingFields() {
011 java.util.ArrayList<String> missingFields = super.missingFields();
012 return missingFields;
013 }
014
015 public void clear() {
016 super.clear();
017 }
018
019 public TestMessageSet clone() {
020 return new TestMessageSet().mergeFrom(this);
021 }
022
023 public TestMessageSet mergeFrom(TestMessageSet other) {
024 return this;
025 }
026
027 public int serializedSizeUnframed() {
028 if (memoizedSerializedSize != -1)
029 return memoizedSerializedSize;
030
031 int size = 0;
032 memoizedSerializedSize = size;
033 return size;
034 }
035
036 public TestMessageSet mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
037 while (true) {
038 int tag = input.readTag();
039 if ((tag & 0x07) == 4) {
040 return this;
041 }
042 switch (tag) {
043 case 0:
044 return this;
045 default: {
046 break;
047 }
048 }
049 }
050 }
051 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
052 }
053
054 public static TestMessageSet parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
055 return new TestMessageSet().mergeUnframed(data).checktInitialized();
056 }
057
058 public static TestMessageSet parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
059 return new TestMessageSet().mergeUnframed(data).checktInitialized();
060 }
061
062 public static TestMessageSet parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
063 return new TestMessageSet().mergeUnframed(data).checktInitialized();
064 }
065
066 public static TestMessageSet parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
067 return new TestMessageSet().mergeUnframed(data).checktInitialized();
068 }
069
070 public static TestMessageSet parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
071 return new TestMessageSet().mergeFramed(data).checktInitialized();
072 }
073
074 public static TestMessageSet parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
075 return new TestMessageSet().mergeFramed(data).checktInitialized();
076 }
077
078 public static TestMessageSet parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
079 return new TestMessageSet().mergeFramed(data).checktInitialized();
080 }
081
082 public static TestMessageSet parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
083 return new TestMessageSet().mergeFramed(data).checktInitialized();
084 }
085
086 public String toString() {
087 return toString(new java.lang.StringBuilder(), "").toString();
088 }
089
090 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
091 return sb;
092 }
093
094 public boolean equals(Object obj) {
095 if( obj==this )
096 return true;
097
098 if( obj==null || obj.getClass()!=TestMessageSet.class )
099 return false;
100
101 return equals((TestMessageSet)obj);
102 }
103
104 public boolean equals(TestMessageSet obj) {
105 return true;
106 }
107
108 public int hashCode() {
109 int rc=888230189;
110 return rc;
111 }
112
113 }
114
115 static abstract class TestMessageSetBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
116
117 }
118
119
120 static public final class TestMessageSetContainer extends TestMessageSetContainerBase<TestMessageSetContainer> {
121
122 public java.util.ArrayList<String> missingFields() {
123 java.util.ArrayList<String> missingFields = super.missingFields();
124 if( hasMessageSet() ) {
125 try {
126 getMessageSet().assertInitialized();
127 } catch (org.apache.activemq.protobuf.UninitializedMessageException e){
128 missingFields.addAll(prefix(e.getMissingFields(),"message_set."));
129 }
130 }
131 return missingFields;
132 }
133
134 public void clear() {
135 super.clear();
136 clearMessageSet();
137 }
138
139 public TestMessageSetContainer clone() {
140 return new TestMessageSetContainer().mergeFrom(this);
141 }
142
143 public TestMessageSetContainer mergeFrom(TestMessageSetContainer other) {
144 if (other.hasMessageSet()) {
145 if (hasMessageSet()) {
146 getMessageSet().mergeFrom(other.getMessageSet());
147 } else {
148 setMessageSet(other.getMessageSet().clone());
149 }
150 }
151 return this;
152 }
153
154 public int serializedSizeUnframed() {
155 if (memoizedSerializedSize != -1)
156 return memoizedSerializedSize;
157
158 int size = 0;
159 if (hasMessageSet()) {
160 size += computeMessageSize(1, getMessageSet());
161 }
162 memoizedSerializedSize = size;
163 return size;
164 }
165
166 public TestMessageSetContainer mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
167 while (true) {
168 int tag = input.readTag();
169 if ((tag & 0x07) == 4) {
170 return this;
171 }
172 switch (tag) {
173 case 0:
174 return this;
175 default: {
176 break;
177 }
178 case 10:
179 if (hasMessageSet()) {
180 getMessageSet().mergeFramed(input);
181 } else {
182 setMessageSet(new TestMessageSet().mergeFramed(input));
183 }
184 break;
185 }
186 }
187 }
188 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
189 if (hasMessageSet()) {
190 writeMessage(output, 1, getMessageSet());
191 }
192 }
193
194 public static TestMessageSetContainer parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
195 return new TestMessageSetContainer().mergeUnframed(data).checktInitialized();
196 }
197
198 public static TestMessageSetContainer parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
199 return new TestMessageSetContainer().mergeUnframed(data).checktInitialized();
200 }
201
202 public static TestMessageSetContainer parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
203 return new TestMessageSetContainer().mergeUnframed(data).checktInitialized();
204 }
205
206 public static TestMessageSetContainer parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
207 return new TestMessageSetContainer().mergeUnframed(data).checktInitialized();
208 }
209
210 public static TestMessageSetContainer parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
211 return new TestMessageSetContainer().mergeFramed(data).checktInitialized();
212 }
213
214 public static TestMessageSetContainer parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
215 return new TestMessageSetContainer().mergeFramed(data).checktInitialized();
216 }
217
218 public static TestMessageSetContainer parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
219 return new TestMessageSetContainer().mergeFramed(data).checktInitialized();
220 }
221
222 public static TestMessageSetContainer parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
223 return new TestMessageSetContainer().mergeFramed(data).checktInitialized();
224 }
225
226 public String toString() {
227 return toString(new java.lang.StringBuilder(), "").toString();
228 }
229
230 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
231 if( hasMessageSet() ) {
232 sb.append(prefix+"message_set {\n");
233 getMessageSet().toString(sb, prefix+" ");
234 sb.append(prefix+"}\n");
235 }
236 return sb;
237 }
238
239 public boolean equals(Object obj) {
240 if( obj==this )
241 return true;
242
243 if( obj==null || obj.getClass()!=TestMessageSetContainer.class )
244 return false;
245
246 return equals((TestMessageSetContainer)obj);
247 }
248
249 public boolean equals(TestMessageSetContainer obj) {
250 if (hasMessageSet() ^ obj.hasMessageSet() )
251 return false;
252 if (hasMessageSet() && ( !getMessageSet().equals(obj.getMessageSet()) ))
253 return false;
254 return true;
255 }
256
257 public int hashCode() {
258 int rc=1456872916;
259 if (hasMessageSet()) {
260 rc ^= ( 302731003^getMessageSet().hashCode() );
261 }
262 return rc;
263 }
264
265 }
266
267 static abstract class TestMessageSetContainerBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
268
269 // optional TestMessageSet message_set = 1;
270 private TestMessageSet f_messageSet = null;
271
272 public boolean hasMessageSet() {
273 return this.f_messageSet!=null;
274 }
275
276 public TestMessageSet getMessageSet() {
277 if( this.f_messageSet == null ) {
278 this.f_messageSet = new TestMessageSet();
279 }
280 return this.f_messageSet;
281 }
282
283 public T setMessageSet(TestMessageSet messageSet) {
284 loadAndClear();
285 this.f_messageSet = messageSet;
286 return (T)this;
287 }
288
289 public void clearMessageSet() {
290 loadAndClear();
291 this.f_messageSet = null;
292 }
293
294 }
295
296
297 static public final class TestMessageSetExtension1 extends TestMessageSetExtension1Base<TestMessageSetExtension1> {
298
299 public java.util.ArrayList<String> missingFields() {
300 java.util.ArrayList<String> missingFields = super.missingFields();
301 return missingFields;
302 }
303
304 public void clear() {
305 super.clear();
306 clearI();
307 }
308
309 public TestMessageSetExtension1 clone() {
310 return new TestMessageSetExtension1().mergeFrom(this);
311 }
312
313 public TestMessageSetExtension1 mergeFrom(TestMessageSetExtension1 other) {
314 if (other.hasI()) {
315 setI(other.getI());
316 }
317 return this;
318 }
319
320 public int serializedSizeUnframed() {
321 if (memoizedSerializedSize != -1)
322 return memoizedSerializedSize;
323
324 int size = 0;
325 if (hasI()) {
326 size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(15, getI());
327 }
328 memoizedSerializedSize = size;
329 return size;
330 }
331
332 public TestMessageSetExtension1 mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
333 while (true) {
334 int tag = input.readTag();
335 if ((tag & 0x07) == 4) {
336 return this;
337 }
338 switch (tag) {
339 case 0:
340 return this;
341 default: {
342 break;
343 }
344 case 120:
345 setI(input.readInt32());
346 break;
347 }
348 }
349 }
350 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
351 if (hasI()) {
352 output.writeInt32(15, getI());
353 }
354 }
355
356 public static TestMessageSetExtension1 parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
357 return new TestMessageSetExtension1().mergeUnframed(data).checktInitialized();
358 }
359
360 public static TestMessageSetExtension1 parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
361 return new TestMessageSetExtension1().mergeUnframed(data).checktInitialized();
362 }
363
364 public static TestMessageSetExtension1 parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
365 return new TestMessageSetExtension1().mergeUnframed(data).checktInitialized();
366 }
367
368 public static TestMessageSetExtension1 parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
369 return new TestMessageSetExtension1().mergeUnframed(data).checktInitialized();
370 }
371
372 public static TestMessageSetExtension1 parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
373 return new TestMessageSetExtension1().mergeFramed(data).checktInitialized();
374 }
375
376 public static TestMessageSetExtension1 parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
377 return new TestMessageSetExtension1().mergeFramed(data).checktInitialized();
378 }
379
380 public static TestMessageSetExtension1 parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
381 return new TestMessageSetExtension1().mergeFramed(data).checktInitialized();
382 }
383
384 public static TestMessageSetExtension1 parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
385 return new TestMessageSetExtension1().mergeFramed(data).checktInitialized();
386 }
387
388 public String toString() {
389 return toString(new java.lang.StringBuilder(), "").toString();
390 }
391
392 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
393 if( hasI() ) {
394 sb.append(prefix+"i: ");
395 sb.append(getI());
396 sb.append("\n");
397 }
398 return sb;
399 }
400
401 public boolean equals(Object obj) {
402 if( obj==this )
403 return true;
404
405 if( obj==null || obj.getClass()!=TestMessageSetExtension1.class )
406 return false;
407
408 return equals((TestMessageSetExtension1)obj);
409 }
410
411 public boolean equals(TestMessageSetExtension1 obj) {
412 if (hasI() ^ obj.hasI() )
413 return false;
414 if (hasI() && ( getI()!=obj.getI() ))
415 return false;
416 return true;
417 }
418
419 public int hashCode() {
420 int rc=258720991;
421 if (hasI()) {
422 rc ^= ( 73^getI() );
423 }
424 return rc;
425 }
426
427 }
428
429 static abstract class TestMessageSetExtension1Base<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
430
431 // optional int32 i = 15;
432 private int f_i = 0;
433 private boolean b_i;
434
435 public boolean hasI() {
436 return this.b_i;
437 }
438
439 public int getI() {
440 return this.f_i;
441 }
442
443 public T setI(int i) {
444 loadAndClear();
445 this.b_i = true;
446 this.f_i = i;
447 return (T)this;
448 }
449
450 public void clearI() {
451 loadAndClear();
452 this.b_i = false;
453 this.f_i = 0;
454 }
455
456 }
457
458
459 static public final class TestMessageSetExtension2 extends TestMessageSetExtension2Base<TestMessageSetExtension2> {
460
461 public java.util.ArrayList<String> missingFields() {
462 java.util.ArrayList<String> missingFields = super.missingFields();
463 return missingFields;
464 }
465
466 public void clear() {
467 super.clear();
468 clearStr();
469 }
470
471 public TestMessageSetExtension2 clone() {
472 return new TestMessageSetExtension2().mergeFrom(this);
473 }
474
475 public TestMessageSetExtension2 mergeFrom(TestMessageSetExtension2 other) {
476 if (other.hasStr()) {
477 setStr(other.getStr());
478 }
479 return this;
480 }
481
482 public int serializedSizeUnframed() {
483 if (memoizedSerializedSize != -1)
484 return memoizedSerializedSize;
485
486 int size = 0;
487 if (hasStr()) {
488 size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(25, getStr());
489 }
490 memoizedSerializedSize = size;
491 return size;
492 }
493
494 public TestMessageSetExtension2 mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
495 while (true) {
496 int tag = input.readTag();
497 if ((tag & 0x07) == 4) {
498 return this;
499 }
500 switch (tag) {
501 case 0:
502 return this;
503 default: {
504 break;
505 }
506 case 202:
507 setStr(input.readString());
508 break;
509 }
510 }
511 }
512 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
513 if (hasStr()) {
514 output.writeString(25, getStr());
515 }
516 }
517
518 public static TestMessageSetExtension2 parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
519 return new TestMessageSetExtension2().mergeUnframed(data).checktInitialized();
520 }
521
522 public static TestMessageSetExtension2 parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
523 return new TestMessageSetExtension2().mergeUnframed(data).checktInitialized();
524 }
525
526 public static TestMessageSetExtension2 parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
527 return new TestMessageSetExtension2().mergeUnframed(data).checktInitialized();
528 }
529
530 public static TestMessageSetExtension2 parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
531 return new TestMessageSetExtension2().mergeUnframed(data).checktInitialized();
532 }
533
534 public static TestMessageSetExtension2 parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
535 return new TestMessageSetExtension2().mergeFramed(data).checktInitialized();
536 }
537
538 public static TestMessageSetExtension2 parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
539 return new TestMessageSetExtension2().mergeFramed(data).checktInitialized();
540 }
541
542 public static TestMessageSetExtension2 parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
543 return new TestMessageSetExtension2().mergeFramed(data).checktInitialized();
544 }
545
546 public static TestMessageSetExtension2 parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
547 return new TestMessageSetExtension2().mergeFramed(data).checktInitialized();
548 }
549
550 public String toString() {
551 return toString(new java.lang.StringBuilder(), "").toString();
552 }
553
554 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
555 if( hasStr() ) {
556 sb.append(prefix+"str: ");
557 sb.append(getStr());
558 sb.append("\n");
559 }
560 return sb;
561 }
562
563 public boolean equals(Object obj) {
564 if( obj==this )
565 return true;
566
567 if( obj==null || obj.getClass()!=TestMessageSetExtension2.class )
568 return false;
569
570 return equals((TestMessageSetExtension2)obj);
571 }
572
573 public boolean equals(TestMessageSetExtension2 obj) {
574 if (hasStr() ^ obj.hasStr() )
575 return false;
576 if (hasStr() && ( !getStr().equals(obj.getStr()) ))
577 return false;
578 return true;
579 }
580
581 public int hashCode() {
582 int rc=258720992;
583 if (hasStr()) {
584 rc ^= ( 83473^getStr().hashCode() );
585 }
586 return rc;
587 }
588
589 }
590
591 static abstract class TestMessageSetExtension2Base<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
592
593 // optional string str = 25;
594 private java.lang.String f_str = null;
595 private boolean b_str;
596
597 public boolean hasStr() {
598 return this.b_str;
599 }
600
601 public java.lang.String getStr() {
602 return this.f_str;
603 }
604
605 public T setStr(java.lang.String str) {
606 loadAndClear();
607 this.b_str = true;
608 this.f_str = str;
609 return (T)this;
610 }
611
612 public void clearStr() {
613 loadAndClear();
614 this.b_str = false;
615 this.f_str = null;
616 }
617
618 }
619
620
621 static public final class RawMessageSet extends RawMessageSetBase<RawMessageSet> {
622
623
624 static public final class Item extends ItemBase<Item> {
625
626 public java.util.ArrayList<String> missingFields() {
627 java.util.ArrayList<String> missingFields = super.missingFields();
628 if( !hasTypeId() ) {
629 missingFields.add("type_id");
630 }
631 if( !hasMessage() ) {
632 missingFields.add("message");
633 }
634 return missingFields;
635 }
636
637 public void clear() {
638 super.clear();
639 clearTypeId();
640 clearMessage();
641 }
642
643 public Item clone() {
644 return new Item().mergeFrom(this);
645 }
646
647 public Item mergeFrom(Item other) {
648 if (other.hasTypeId()) {
649 setTypeId(other.getTypeId());
650 }
651 if (other.hasMessage()) {
652 setMessage(other.getMessage());
653 }
654 return this;
655 }
656
657 public int serializedSizeUnframed() {
658 if (memoizedSerializedSize != -1)
659 return memoizedSerializedSize;
660
661 int size = 0;
662 if (hasTypeId()) {
663 size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(2, getTypeId());
664 }
665 if (hasMessage()) {
666 size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(3, getMessage());
667 }
668 memoizedSerializedSize = size;
669 return size;
670 }
671
672 public Item mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
673 while (true) {
674 int tag = input.readTag();
675 if ((tag & 0x07) == 4) {
676 return this;
677 }
678 switch (tag) {
679 case 0:
680 return this;
681 default: {
682 break;
683 }
684 case 16:
685 setTypeId(input.readInt32());
686 break;
687 case 26:
688 setMessage(input.readBytes());
689 break;
690 }
691 }
692 }
693 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
694 if (hasTypeId()) {
695 output.writeInt32(2, getTypeId());
696 }
697 if (hasMessage()) {
698 output.writeBytes(3, getMessage());
699 }
700 }
701
702 public static Item parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
703 return new Item().mergeUnframed(data).checktInitialized();
704 }
705
706 public static Item parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
707 return new Item().mergeUnframed(data).checktInitialized();
708 }
709
710 public static Item parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
711 return new Item().mergeUnframed(data).checktInitialized();
712 }
713
714 public static Item parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
715 return new Item().mergeUnframed(data).checktInitialized();
716 }
717
718 public static Item parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
719 return new Item().mergeFramed(data).checktInitialized();
720 }
721
722 public static Item parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
723 return new Item().mergeFramed(data).checktInitialized();
724 }
725
726 public static Item parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
727 return new Item().mergeFramed(data).checktInitialized();
728 }
729
730 public static Item parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
731 return new Item().mergeFramed(data).checktInitialized();
732 }
733
734 public String toString() {
735 return toString(new java.lang.StringBuilder(), "").toString();
736 }
737
738 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
739 if( hasTypeId() ) {
740 sb.append(prefix+"type_id: ");
741 sb.append(getTypeId());
742 sb.append("\n");
743 }
744 if( hasMessage() ) {
745 sb.append(prefix+"message: ");
746 sb.append(getMessage());
747 sb.append("\n");
748 }
749 return sb;
750 }
751
752 public boolean equals(Object obj) {
753 if( obj==this )
754 return true;
755
756 if( obj==null || obj.getClass()!=Item.class )
757 return false;
758
759 return equals((Item)obj);
760 }
761
762 public boolean equals(Item obj) {
763 if (hasTypeId() ^ obj.hasTypeId() )
764 return false;
765 if (hasTypeId() && ( getTypeId()!=obj.getTypeId() ))
766 return false;
767 if (hasMessage() ^ obj.hasMessage() )
768 return false;
769 if (hasMessage() && ( !getMessage().equals(obj.getMessage()) ))
770 return false;
771 return true;
772 }
773
774 public int hashCode() {
775 int rc=2289459;
776 if (hasTypeId()) {
777 rc ^= ( -1774936555^getTypeId() );
778 }
779 if (hasMessage()) {
780 rc ^= ( -1675388953^getMessage().hashCode() );
781 }
782 return rc;
783 }
784
785 }
786
787 static abstract class ItemBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
788
789 // required int32 type_id = 2;
790 private int f_typeId = 0;
791 private boolean b_typeId;
792
793 public boolean hasTypeId() {
794 return this.b_typeId;
795 }
796
797 public int getTypeId() {
798 return this.f_typeId;
799 }
800
801 public T setTypeId(int typeId) {
802 loadAndClear();
803 this.b_typeId = true;
804 this.f_typeId = typeId;
805 return (T)this;
806 }
807
808 public void clearTypeId() {
809 loadAndClear();
810 this.b_typeId = false;
811 this.f_typeId = 0;
812 }
813
814 // required bytes message = 3;
815 private org.apache.activemq.protobuf.Buffer f_message = null;
816 private boolean b_message;
817
818 public boolean hasMessage() {
819 return this.b_message;
820 }
821
822 public org.apache.activemq.protobuf.Buffer getMessage() {
823 return this.f_message;
824 }
825
826 public T setMessage(org.apache.activemq.protobuf.Buffer message) {
827 loadAndClear();
828 this.b_message = true;
829 this.f_message = message;
830 return (T)this;
831 }
832
833 public void clearMessage() {
834 loadAndClear();
835 this.b_message = false;
836 this.f_message = null;
837 }
838
839 }
840
841 public java.util.ArrayList<String> missingFields() {
842 java.util.ArrayList<String> missingFields = super.missingFields();
843 if( hasItem() ) {
844 java.util.List<RawMessageSet.Item> l = getItemList();
845 for( int i=0; i < l.size(); i++ ) {
846 try {
847 l.get(i).assertInitialized();
848 } catch (org.apache.activemq.protobuf.UninitializedMessageException e){
849 missingFields.addAll(prefix(e.getMissingFields(),"Item["+i+"]"));
850 }
851 }
852 }
853 return missingFields;
854 }
855
856 public void clear() {
857 super.clear();
858 clearItem();
859 }
860
861 public RawMessageSet clone() {
862 return new RawMessageSet().mergeFrom(this);
863 }
864
865 public RawMessageSet mergeFrom(RawMessageSet other) {
866 if (other.hasItem()) {
867 for(RawMessageSet.Item element: other.getItemList() ) {
868 getItemList().add(element.clone());
869 }
870 }
871 return this;
872 }
873
874 public int serializedSizeUnframed() {
875 if (memoizedSerializedSize != -1)
876 return memoizedSerializedSize;
877
878 int size = 0;
879 if (hasItem()) {
880 for (RawMessageSet.Item i : getItemList()) {
881 size += computeGroupSize(1, i);
882 }
883 }
884 memoizedSerializedSize = size;
885 return size;
886 }
887
888 public RawMessageSet mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
889 while (true) {
890 int tag = input.readTag();
891 if ((tag & 0x07) == 4) {
892 return this;
893 }
894 switch (tag) {
895 case 0:
896 return this;
897 default: {
898 break;
899 }
900 case 11:
901 getItemList().add(readGroup(input, 1, new RawMessageSet.Item()));
902
903 break;
904 }
905 }
906 }
907 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
908 if (hasItem()) {
909 for (RawMessageSet.Item i : getItemList()) {
910 writeGroup(output, 1, i);
911 }
912 }
913 }
914
915 public static RawMessageSet parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
916 return new RawMessageSet().mergeUnframed(data).checktInitialized();
917 }
918
919 public static RawMessageSet parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
920 return new RawMessageSet().mergeUnframed(data).checktInitialized();
921 }
922
923 public static RawMessageSet parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
924 return new RawMessageSet().mergeUnframed(data).checktInitialized();
925 }
926
927 public static RawMessageSet parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
928 return new RawMessageSet().mergeUnframed(data).checktInitialized();
929 }
930
931 public static RawMessageSet parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
932 return new RawMessageSet().mergeFramed(data).checktInitialized();
933 }
934
935 public static RawMessageSet parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
936 return new RawMessageSet().mergeFramed(data).checktInitialized();
937 }
938
939 public static RawMessageSet parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
940 return new RawMessageSet().mergeFramed(data).checktInitialized();
941 }
942
943 public static RawMessageSet parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
944 return new RawMessageSet().mergeFramed(data).checktInitialized();
945 }
946
947 public String toString() {
948 return toString(new java.lang.StringBuilder(), "").toString();
949 }
950
951 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
952 if( hasItem() ) {
953 java.util.List<RawMessageSet.Item> l = getItemList();
954 for( int i=0; i < l.size(); i++ ) {
955 sb.append(prefix+"Item["+i+"] {\n");
956 l.get(i).toString(sb, prefix+" ");
957 sb.append(prefix+"}\n");
958 }
959 }
960 return sb;
961 }
962
963 public boolean equals(Object obj) {
964 if( obj==this )
965 return true;
966
967 if( obj==null || obj.getClass()!=RawMessageSet.class )
968 return false;
969
970 return equals((RawMessageSet)obj);
971 }
972
973 public boolean equals(RawMessageSet obj) {
974 if (hasItem() ^ obj.hasItem() )
975 return false;
976 if (hasItem() && ( !getItemList().equals(obj.getItemList()) ))
977 return false;
978 return true;
979 }
980
981 public int hashCode() {
982 int rc=-1734204157;
983 if (hasItem()) {
984 rc ^= ( 2289459^getItemList().hashCode() );
985 }
986 return rc;
987 }
988
989 }
990
991 static abstract class RawMessageSetBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
992
993 // repeated Item Item = 1;
994 private java.util.List<RawMessageSet.Item> f_item;
995
996 public boolean hasItem() {
997 return this.f_item!=null && !this.f_item.isEmpty();
998 }
999
1000 public java.util.List<RawMessageSet.Item> getItemList() {
1001 if( this.f_item == null ) {
1002 this.f_item = new java.util.ArrayList<RawMessageSet.Item>();
1003 }
1004 return this.f_item;
1005 }
1006
1007 public T setItemList(java.util.List<RawMessageSet.Item> item) {
1008 loadAndClear();
1009 this.f_item = item;
1010 return (T)this;
1011 }
1012
1013 public int getItemCount() {
1014 if( this.f_item == null ) {
1015 return 0;
1016 }
1017 return this.f_item.size();
1018 }
1019
1020 public RawMessageSet.Item getItem(int index) {
1021 if( this.f_item == null ) {
1022 return null;
1023 }
1024 return this.f_item.get(index);
1025 }
1026
1027 public T setItem(int index, RawMessageSet.Item value) {
1028 loadAndClear();
1029 getItemList().set(index, value);
1030 return (T)this;
1031 }
1032
1033 public T addItem(RawMessageSet.Item value) {
1034 loadAndClear();
1035 getItemList().add(value);
1036 return (T)this;
1037 }
1038
1039 public T addAllItem(java.lang.Iterable<? extends RawMessageSet.Item> collection) {
1040 loadAndClear();
1041 super.addAll(collection, getItemList());
1042 return (T)this;
1043 }
1044
1045 public void clearItem() {
1046 loadAndClear();
1047 this.f_item = null;
1048 }
1049
1050 }
1051
1052 }