001//
002// Generated by protoc, do not edit by hand.
003//
004package org.apache.activemq.console.command.store.proto;
005
006
007public class QueueEntryPB implements org.fusesource.hawtbuf.proto.PBMessageFactory<QueueEntryPB.Bean, QueueEntryPB.Buffer> {
008
009   public static final QueueEntryPB FACTORY = new QueueEntryPB();
010   public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec<Buffer> FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec<Buffer>(FACTORY);
011   public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec<Buffer> UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec<Buffer>(FACTORY);
012
013   public Bean create()  {
014      return new Bean();
015   }
016
017   public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
018      return new Bean().mergeUnframed(data);
019   }
020
021   public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
022      return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data));
023   }
024
025   public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
026      return new Buffer(data);
027   }
028
029   public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
030      return parseUnframed(new org.fusesource.hawtbuf.Buffer(data));
031   }
032
033   public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
034      int length = data.readRawVarint32();
035      int oldLimit = data.pushLimit(length);
036      Buffer rc = parseUnframed(data.readRawBytes(length));
037      data.popLimit(oldLimit);
038      return rc;
039   }
040
041   public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
042      try {
043         org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data);
044         Buffer rc = parseFramed(input);
045         input.checkLastTagWas(0);
046         return rc;
047      } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) {
048         throw e;
049      } catch (java.io.IOException e) {
050         throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
051      }
052   }
053
054   public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
055      return parseFramed(new org.fusesource.hawtbuf.Buffer(data));
056   }
057
058   public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
059      return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data));
060   }
061
062   public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage<QueueEntryPB.Bean, QueueEntryPB.Buffer> {
063
064      // required int64 queueKey = 1;
065      public boolean hasQueueKey();
066      public long getQueueKey();
067      // required int64 queueSeq = 2;
068      public boolean hasQueueSeq();
069      public long getQueueSeq();
070      // required int64 messageKey = 3;
071      public boolean hasMessageKey();
072      public long getMessageKey();
073      // optional int32 size = 4;
074      public boolean hasSize();
075      public int getSize();
076      // optional bytes attachment = 5;
077      public boolean hasAttachment();
078      public org.fusesource.hawtbuf.Buffer getAttachment();
079      // optional int32 redeliveries = 6;
080      public boolean hasRedeliveries();
081      public int getRedeliveries();
082      // optional sint64 expiration = 7;
083      public boolean hasExpiration();
084      public long getExpiration();
085      // optional bytes messageLocator = 8;
086      public boolean hasMessageLocator();
087      public org.fusesource.hawtbuf.Buffer getMessageLocator();
088      // repeated bytes sender = 9;
089      public boolean hasSender();
090      public java.util.List<org.fusesource.hawtbuf.Buffer> getSenderList();
091      public int getSenderCount();
092      public org.fusesource.hawtbuf.Buffer getSender(int index);
093      public Bean copy();
094      public Buffer freeze();
095      public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
096   }
097
098   static public final class Bean implements Getter {
099
100      Buffer frozen;
101      Bean bean;
102
103      public Bean() {
104         this.bean = this;
105      }
106
107      public Bean(Bean copy) {
108         this.bean = copy;
109      }
110
111      public Bean copy() {
112         return new Bean(bean);
113      }
114
115      public boolean frozen() {
116         return frozen!=null;
117      }
118
119      public Buffer freeze() {
120         if( frozen==null ) {
121            frozen = new Buffer(bean);
122            assert deepFreeze();
123         }
124         return frozen;
125      }
126
127      private boolean deepFreeze() {
128         frozen.serializedSizeUnframed();
129         return true;
130      }
131
132      private void copyCheck() {
133         assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
134         if (bean != this) {
135            copy(bean);
136         }
137      }
138
139      private void copy(Bean other) {
140         this.bean = this;
141         this.f_queueKey = other.f_queueKey;
142         this.b_queueKey = other.b_queueKey;
143         this.f_queueSeq = other.f_queueSeq;
144         this.b_queueSeq = other.b_queueSeq;
145         this.f_messageKey = other.f_messageKey;
146         this.b_messageKey = other.b_messageKey;
147         this.f_size = other.f_size;
148         this.b_size = other.b_size;
149         this.f_attachment = other.f_attachment;
150         this.f_redeliveries = other.f_redeliveries;
151         this.b_redeliveries = other.b_redeliveries;
152         this.f_expiration = other.f_expiration;
153         this.b_expiration = other.b_expiration;
154         this.f_messageLocator = other.f_messageLocator;
155         this.f_sender = other.f_sender;
156         if( this.f_sender !=null && !other.frozen()) {
157            this.f_sender = new java.util.ArrayList<org.fusesource.hawtbuf.Buffer>(this.f_sender);
158         }
159      }
160
161      // required int64 queueKey = 1;
162      private long f_queueKey = 0;
163      private boolean b_queueKey;
164
165      public boolean hasQueueKey() {
166         return bean.b_queueKey;
167      }
168
169      public long getQueueKey() {
170         return bean.f_queueKey;
171      }
172
173      public Bean setQueueKey(long queueKey) {
174         copyCheck();
175         this.b_queueKey = true;
176         this.f_queueKey = queueKey;
177         return this;
178      }
179
180      public void clearQueueKey() {
181         copyCheck();
182         this.b_queueKey = false;
183         this.f_queueKey = 0;
184      }
185
186      // required int64 queueSeq = 2;
187      private long f_queueSeq = 0;
188      private boolean b_queueSeq;
189
190      public boolean hasQueueSeq() {
191         return bean.b_queueSeq;
192      }
193
194      public long getQueueSeq() {
195         return bean.f_queueSeq;
196      }
197
198      public Bean setQueueSeq(long queueSeq) {
199         copyCheck();
200         this.b_queueSeq = true;
201         this.f_queueSeq = queueSeq;
202         return this;
203      }
204
205      public void clearQueueSeq() {
206         copyCheck();
207         this.b_queueSeq = false;
208         this.f_queueSeq = 0;
209      }
210
211      // required int64 messageKey = 3;
212      private long f_messageKey = 0;
213      private boolean b_messageKey;
214
215      public boolean hasMessageKey() {
216         return bean.b_messageKey;
217      }
218
219      public long getMessageKey() {
220         return bean.f_messageKey;
221      }
222
223      public Bean setMessageKey(long messageKey) {
224         copyCheck();
225         this.b_messageKey = true;
226         this.f_messageKey = messageKey;
227         return this;
228      }
229
230      public void clearMessageKey() {
231         copyCheck();
232         this.b_messageKey = false;
233         this.f_messageKey = 0;
234      }
235
236      // optional int32 size = 4;
237      private int f_size = 0;
238      private boolean b_size;
239
240      public boolean hasSize() {
241         return bean.b_size;
242      }
243
244      public int getSize() {
245         return bean.f_size;
246      }
247
248      public Bean setSize(int size) {
249         copyCheck();
250         this.b_size = true;
251         this.f_size = size;
252         return this;
253      }
254
255      public void clearSize() {
256         copyCheck();
257         this.b_size = false;
258         this.f_size = 0;
259      }
260
261      // optional bytes attachment = 5;
262      private org.fusesource.hawtbuf.Buffer f_attachment = null;
263
264      public boolean hasAttachment() {
265         return bean.f_attachment!=null;
266      }
267
268      public org.fusesource.hawtbuf.Buffer getAttachment() {
269         return bean.f_attachment;
270      }
271
272      public Bean setAttachment(org.fusesource.hawtbuf.Buffer attachment) {
273         copyCheck();
274         this.f_attachment = attachment;
275         return this;
276      }
277
278      public void clearAttachment() {
279         copyCheck();
280         this.f_attachment = null;
281      }
282
283      // optional int32 redeliveries = 6;
284      private int f_redeliveries = 0;
285      private boolean b_redeliveries;
286
287      public boolean hasRedeliveries() {
288         return bean.b_redeliveries;
289      }
290
291      public int getRedeliveries() {
292         return bean.f_redeliveries;
293      }
294
295      public Bean setRedeliveries(int redeliveries) {
296         copyCheck();
297         this.b_redeliveries = true;
298         this.f_redeliveries = redeliveries;
299         return this;
300      }
301
302      public void clearRedeliveries() {
303         copyCheck();
304         this.b_redeliveries = false;
305         this.f_redeliveries = 0;
306      }
307
308      // optional sint64 expiration = 7;
309      private long f_expiration = 0;
310      private boolean b_expiration;
311
312      public boolean hasExpiration() {
313         return bean.b_expiration;
314      }
315
316      public long getExpiration() {
317         return bean.f_expiration;
318      }
319
320      public Bean setExpiration(long expiration) {
321         copyCheck();
322         this.b_expiration = true;
323         this.f_expiration = expiration;
324         return this;
325      }
326
327      public void clearExpiration() {
328         copyCheck();
329         this.b_expiration = false;
330         this.f_expiration = 0;
331      }
332
333      // optional bytes messageLocator = 8;
334      private org.fusesource.hawtbuf.Buffer f_messageLocator = null;
335
336      public boolean hasMessageLocator() {
337         return bean.f_messageLocator!=null;
338      }
339
340      public org.fusesource.hawtbuf.Buffer getMessageLocator() {
341         return bean.f_messageLocator;
342      }
343
344      public Bean setMessageLocator(org.fusesource.hawtbuf.Buffer messageLocator) {
345         copyCheck();
346         this.f_messageLocator = messageLocator;
347         return this;
348      }
349
350      public void clearMessageLocator() {
351         copyCheck();
352         this.f_messageLocator = null;
353      }
354
355      // repeated bytes sender = 9;
356      private java.util.List<org.fusesource.hawtbuf.Buffer> f_sender;
357
358      public boolean hasSender() {
359         return bean.f_sender!=null && !bean.f_sender.isEmpty();
360      }
361
362      public java.util.List<org.fusesource.hawtbuf.Buffer> getSenderList() {
363         return bean.f_sender;
364      }
365
366      public java.util.List<org.fusesource.hawtbuf.Buffer> createSenderList() {
367         copyCheck();
368         if( this.f_sender == null ) {
369            this.f_sender = new java.util.ArrayList<org.fusesource.hawtbuf.Buffer>();
370         }
371         return bean.f_sender;
372      }
373
374      public Bean setSenderList(java.util.List<org.fusesource.hawtbuf.Buffer> sender) {
375         copyCheck();
376         this.f_sender = sender;
377         return this;
378      }
379
380      public int getSenderCount() {
381         if( bean.f_sender == null ) {
382            return 0;
383         }
384         return bean.f_sender.size();
385      }
386
387      public org.fusesource.hawtbuf.Buffer getSender(int index) {
388         if( bean.f_sender == null ) {
389            return null;
390         }
391         return bean.f_sender.get(index);
392      }
393
394      public Bean setSender(int index, org.fusesource.hawtbuf.Buffer value) {
395         this.createSenderList().set(index, value);
396         return this;
397      }
398
399      public Bean addSender(org.fusesource.hawtbuf.Buffer value) {
400         this.createSenderList().add(value);
401         return this;
402      }
403
404      public Bean addAllSender(java.lang.Iterable<? extends org.fusesource.hawtbuf.Buffer> collection) {
405         org.fusesource.hawtbuf.proto.MessageBufferSupport.addAll(collection, this.createSenderList());
406         return this;
407      }
408
409      public void clearSender() {
410         copyCheck();
411         this.f_sender = null;
412      }
413
414      public String toString() {
415         return toString(new java.lang.StringBuilder(), "").toString();
416      }
417
418      public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
419         if(  hasQueueKey() ) {
420            sb.append(prefix+"queueKey: ");
421            sb.append(getQueueKey());
422            sb.append("\n");
423         }
424         if(  hasQueueSeq() ) {
425            sb.append(prefix+"queueSeq: ");
426            sb.append(getQueueSeq());
427            sb.append("\n");
428         }
429         if(  hasMessageKey() ) {
430            sb.append(prefix+"messageKey: ");
431            sb.append(getMessageKey());
432            sb.append("\n");
433         }
434         if(  hasSize() ) {
435            sb.append(prefix+"size: ");
436            sb.append(getSize());
437            sb.append("\n");
438         }
439         if(  hasAttachment() ) {
440            sb.append(prefix+"attachment: ");
441            sb.append(getAttachment());
442            sb.append("\n");
443         }
444         if(  hasRedeliveries() ) {
445            sb.append(prefix+"redeliveries: ");
446            sb.append(getRedeliveries());
447            sb.append("\n");
448         }
449         if(  hasExpiration() ) {
450            sb.append(prefix+"expiration: ");
451            sb.append(getExpiration());
452            sb.append("\n");
453         }
454         if(  hasMessageLocator() ) {
455            sb.append(prefix+"messageLocator: ");
456            sb.append(getMessageLocator());
457            sb.append("\n");
458         }
459         if(  hasSender() ) {
460            java.util.List<org.fusesource.hawtbuf.Buffer> l = getSenderList();
461            for( int i=0; i < l.size(); i++ ) {
462               sb.append(prefix+"sender["+i+"]: ");
463               sb.append(l.get(i));
464               sb.append("\n");
465            }
466         }
467         return sb;
468      }
469
470      public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException {
471         return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input));
472      }
473
474      public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException {
475         copyCheck();
476         while (true) {
477            int tag = input.readTag();
478            if ((tag & 0x07) == 4) {
479               return this;
480            }
481            switch (tag) {
482            case 0:
483               return this;
484            default: {
485               input.skipField(tag);
486               break;
487            }
488            case 8:
489               setQueueKey(input.readInt64());
490               break;
491            case 16:
492               setQueueSeq(input.readInt64());
493               break;
494            case 24:
495               setMessageKey(input.readInt64());
496               break;
497            case 32:
498               setSize(input.readInt32());
499               break;
500            case 42:
501               setAttachment(input.readBytes());
502               break;
503            case 48:
504               setRedeliveries(input.readInt32());
505               break;
506            case 56:
507               setExpiration(input.readSInt64());
508               break;
509            case 66:
510               setMessageLocator(input.readBytes());
511               break;
512            case 74:
513               createSenderList().add(input.readBytes());
514               break;
515            }
516         }
517      }
518      public boolean equals(Object obj) {
519         if( obj==this )
520            return true;
521         
522         if( obj==null || obj.getClass()!=Bean.class )
523            return false;
524         
525         return equals((Bean)obj);
526      }
527      
528      public boolean equals(Bean obj) {
529         if (hasQueueKey() ^ obj.hasQueueKey() ) 
530            return false;
531         if (hasQueueKey() && ( getQueueKey()!=obj.getQueueKey() ))
532            return false;
533         if (hasQueueSeq() ^ obj.hasQueueSeq() ) 
534            return false;
535         if (hasQueueSeq() && ( getQueueSeq()!=obj.getQueueSeq() ))
536            return false;
537         if (hasMessageKey() ^ obj.hasMessageKey() ) 
538            return false;
539         if (hasMessageKey() && ( getMessageKey()!=obj.getMessageKey() ))
540            return false;
541         if (hasSize() ^ obj.hasSize() ) 
542            return false;
543         if (hasSize() && ( getSize()!=obj.getSize() ))
544            return false;
545         if (hasAttachment() ^ obj.hasAttachment() ) 
546            return false;
547         if (hasAttachment() && ( !getAttachment().equals(obj.getAttachment()) ))
548            return false;
549         if (hasRedeliveries() ^ obj.hasRedeliveries() ) 
550            return false;
551         if (hasRedeliveries() && ( getRedeliveries()!=obj.getRedeliveries() ))
552            return false;
553         if (hasExpiration() ^ obj.hasExpiration() ) 
554            return false;
555         if (hasExpiration() && ( getExpiration()!=obj.getExpiration() ))
556            return false;
557         if (hasMessageLocator() ^ obj.hasMessageLocator() ) 
558            return false;
559         if (hasMessageLocator() && ( !getMessageLocator().equals(obj.getMessageLocator()) ))
560            return false;
561         if (hasSender() ^ obj.hasSender() ) 
562            return false;
563         if (hasSender() && ( !getSenderList().equals(obj.getSenderList()) ))
564            return false;
565         return true;
566      }
567      
568      public int hashCode() {
569         int rc=2066384;
570         if (hasQueueKey()) {
571            rc ^= ( -1099854930^(new Long(getQueueKey())).hashCode() );
572         }
573         if (hasQueueSeq()) {
574            rc ^= ( -1099847250^(new Long(getQueueSeq())).hashCode() );
575         }
576         if (hasMessageKey()) {
577            rc ^= ( 302723320^(new Long(getMessageKey())).hashCode() );
578         }
579         if (hasSize()) {
580            rc ^= ( 2577441^getSize() );
581         }
582         if (hasAttachment()) {
583            rc ^= ( 29963587^getAttachment().hashCode() );
584         }
585         if (hasRedeliveries()) {
586            rc ^= ( 1969176101^getRedeliveries() );
587         }
588         if (hasExpiration()) {
589            rc ^= ( 1155999439^(new Long(getExpiration())).hashCode() );
590         }
591         if (hasMessageLocator()) {
592            rc ^= ( 193493679^getMessageLocator().hashCode() );
593         }
594         if (hasSender()) {
595            rc ^= ( -1822095787^getSenderList().hashCode() );
596         }
597         return rc;
598      }
599      
600      public Bean mergeFrom(Getter other) {
601         copyCheck();
602         if (other.hasQueueKey()) {
603            setQueueKey(other.getQueueKey());
604         }
605         if (other.hasQueueSeq()) {
606            setQueueSeq(other.getQueueSeq());
607         }
608         if (other.hasMessageKey()) {
609            setMessageKey(other.getMessageKey());
610         }
611         if (other.hasSize()) {
612            setSize(other.getSize());
613         }
614         if (other.hasAttachment()) {
615            setAttachment(other.getAttachment());
616         }
617         if (other.hasRedeliveries()) {
618            setRedeliveries(other.getRedeliveries());
619         }
620         if (other.hasExpiration()) {
621            setExpiration(other.getExpiration());
622         }
623         if (other.hasMessageLocator()) {
624            setMessageLocator(other.getMessageLocator());
625         }
626         if (other.hasSender()) {
627            getSenderList().addAll(other.getSenderList());
628         }
629         return this;
630      }
631
632      public void clear() {
633         clearQueueKey();
634         clearQueueSeq();
635         clearMessageKey();
636         clearSize();
637         clearAttachment();
638         clearRedeliveries();
639         clearExpiration();
640         clearMessageLocator();
641         clearSender();
642      }
643
644      public void readExternal(java.io.DataInput in) throws java.io.IOException {
645         assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
646         bean = this;
647         frozen = null;
648         f_queueKey = in.readLong();
649         b_queueKey = true;
650         f_queueSeq = in.readLong();
651         b_queueSeq = true;
652         f_messageKey = in.readLong();
653         b_messageKey = true;
654         f_size = in.readInt();
655         b_size = true;
656         {
657            int size = in.readInt();
658            if( size>=0 ) {
659               byte b[] = new byte[size];
660               in.readFully(b);
661               f_attachment = new org.fusesource.hawtbuf.Buffer(b);
662            } else {
663               f_attachment = null;
664            }
665         }
666         f_redeliveries = in.readInt();
667         b_redeliveries = true;
668         f_expiration = in.readLong();
669         b_expiration = true;
670         {
671            int size = in.readInt();
672            if( size>=0 ) {
673               byte b[] = new byte[size];
674               in.readFully(b);
675               f_messageLocator = new org.fusesource.hawtbuf.Buffer(b);
676            } else {
677               f_messageLocator = null;
678            }
679         }
680         {
681            int size = in.readShort();
682            if( size>=0 ) {
683               f_sender = new java.util.ArrayList<org.fusesource.hawtbuf.Buffer>(size);
684               for(int i=0; i<size; i++) {
685                  byte b[] = new byte[in.readInt()];
686                  in.readFully(b);
687                  f_sender.add(new org.fusesource.hawtbuf.Buffer(b));
688               }
689            } else {
690               f_sender = null;
691            }
692         }
693      }
694
695      public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
696         out.writeLong(bean.f_queueKey);
697         out.writeLong(bean.f_queueSeq);
698         out.writeLong(bean.f_messageKey);
699         out.writeInt(bean.f_size);
700         if( bean.f_attachment!=null ) {
701            out.writeInt(bean.f_attachment.getLength());
702            out.write(bean.f_attachment.getData(), bean.f_attachment.getOffset(), bean.f_attachment.getLength());
703         } else {
704            out.writeInt(-1);
705         }
706         out.writeInt(bean.f_redeliveries);
707         out.writeLong(bean.f_expiration);
708         if( bean.f_messageLocator!=null ) {
709            out.writeInt(bean.f_messageLocator.getLength());
710            out.write(bean.f_messageLocator.getData(), bean.f_messageLocator.getOffset(), bean.f_messageLocator.getLength());
711         } else {
712            out.writeInt(-1);
713         }
714         if( bean.f_sender!=null ) {
715            out.writeShort(bean.f_sender.size());
716            for(org.fusesource.hawtbuf.Buffer o : bean.f_sender) {
717               out.writeInt(o.getLength());
718               out.write(o.getData(), o.getOffset(), o.getLength());
719            }
720         } else {
721            out.writeShort(-1);
722         }
723      }
724
725   }
726
727   static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer<QueueEntryPB.Bean, QueueEntryPB.Buffer>, Getter {
728
729      private Bean bean;
730      private org.fusesource.hawtbuf.Buffer buffer;
731      private int size=-1;
732      private int hashCode;
733
734      private Buffer(org.fusesource.hawtbuf.Buffer buffer) {
735         this.buffer = buffer;
736      }
737
738      private Buffer(Bean bean) {
739         this.bean = bean;
740      }
741
742      public Bean copy() {
743         return bean().copy();
744      }
745
746      public Buffer freeze() {
747         return this;
748      }
749
750      private Bean bean() {
751         if (bean == null) {
752            try {
753               bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer));
754               bean.frozen=this;
755            } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) {
756               throw new RuntimeException(e);
757            } catch (java.io.IOException e) {
758               throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
759            }
760         }
761         return bean;
762      }
763
764      public String toString() {
765         return bean().toString();
766      }
767
768      public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
769         return bean().toString(sb, prefix);
770      }
771
772      // required int64 queueKey = 1;
773      public boolean hasQueueKey() {
774         return bean().hasQueueKey();
775      }
776
777      public long getQueueKey() {
778         return bean().getQueueKey();
779      }
780
781      // required int64 queueSeq = 2;
782      public boolean hasQueueSeq() {
783         return bean().hasQueueSeq();
784      }
785
786      public long getQueueSeq() {
787         return bean().getQueueSeq();
788      }
789
790      // required int64 messageKey = 3;
791      public boolean hasMessageKey() {
792         return bean().hasMessageKey();
793      }
794
795      public long getMessageKey() {
796         return bean().getMessageKey();
797      }
798
799      // optional int32 size = 4;
800      public boolean hasSize() {
801         return bean().hasSize();
802      }
803
804      public int getSize() {
805         return bean().getSize();
806      }
807
808      // optional bytes attachment = 5;
809      public boolean hasAttachment() {
810         return bean().hasAttachment();
811      }
812
813      public org.fusesource.hawtbuf.Buffer getAttachment() {
814         return bean().getAttachment();
815      }
816
817      // optional int32 redeliveries = 6;
818      public boolean hasRedeliveries() {
819         return bean().hasRedeliveries();
820      }
821
822      public int getRedeliveries() {
823         return bean().getRedeliveries();
824      }
825
826      // optional sint64 expiration = 7;
827      public boolean hasExpiration() {
828         return bean().hasExpiration();
829      }
830
831      public long getExpiration() {
832         return bean().getExpiration();
833      }
834
835      // optional bytes messageLocator = 8;
836      public boolean hasMessageLocator() {
837         return bean().hasMessageLocator();
838      }
839
840      public org.fusesource.hawtbuf.Buffer getMessageLocator() {
841         return bean().getMessageLocator();
842      }
843
844      // repeated bytes sender = 9;
845      public boolean hasSender() {
846         return bean().hasSender();
847      }
848
849      public java.util.List<org.fusesource.hawtbuf.Buffer> getSenderList() {
850         return bean().getSenderList();
851      }
852
853      public int getSenderCount() {
854         return bean().getSenderCount();
855      }
856
857      public org.fusesource.hawtbuf.Buffer getSender(int index) {
858         return bean().getSender(index);
859      }
860
861      public org.fusesource.hawtbuf.Buffer toUnframedBuffer() {
862         if( buffer !=null ) {
863            return buffer;
864         }
865         return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this);
866      }
867
868      public org.fusesource.hawtbuf.Buffer toFramedBuffer() {
869         return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this);
870      }
871
872      public byte[] toUnframedByteArray() {
873         return toUnframedBuffer().toByteArray();
874      }
875
876      public byte[] toFramedByteArray() {
877         return toFramedBuffer().toByteArray();
878      }
879
880      public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
881         output.writeRawVarint32(serializedSizeUnframed());
882         writeUnframed(output);
883      }
884
885      public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
886         org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
887         writeFramed(codedOutput);
888         codedOutput.flush();
889      }
890
891      public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
892         org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
893         writeUnframed(codedOutput);
894         codedOutput.flush();
895      }
896
897      public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
898         if (buffer == null) {
899            int size = serializedSizeUnframed();
900            buffer = output.getNextBuffer(size);
901            org.fusesource.hawtbuf.proto.CodedOutputStream original=null;
902            if( buffer == null ) {
903               buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]);
904               original = output;
905               output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer);
906            }
907            output.writeInt64(1, bean.getQueueKey());
908            output.writeInt64(2, bean.getQueueSeq());
909            output.writeInt64(3, bean.getMessageKey());
910            if (bean.hasSize()) {
911               output.writeInt32(4, bean.getSize());
912            }
913            if (bean.hasAttachment()) {
914               output.writeBytes(5, bean.getAttachment());
915            }
916            if (bean.hasRedeliveries()) {
917               output.writeInt32(6, bean.getRedeliveries());
918            }
919            if (bean.hasExpiration()) {
920               output.writeSInt64(7, bean.getExpiration());
921            }
922            if (bean.hasMessageLocator()) {
923               output.writeBytes(8, bean.getMessageLocator());
924            }
925            if (bean.hasSender()) {
926               for (org.fusesource.hawtbuf.Buffer i : bean.getSenderList()) {
927                  output.writeBytes(9, i);
928               }
929            }
930            if( original !=null ) {
931               output.checkNoSpaceLeft();
932               output = original;
933               output.writeRawBytes(buffer);
934            }
935         } else {
936            output.writeRawBytes(buffer);
937         }
938      }
939
940      public int serializedSizeFramed() {
941         int t = serializedSizeUnframed();
942         return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t;
943      }
944
945      public int serializedSizeUnframed() {
946         if (buffer != null) {
947            return buffer.length;
948         }
949         if (size != -1)
950            return size;
951
952         size = 0;
953         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getQueueKey());
954         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(2, getQueueSeq());
955         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(3, getMessageKey());
956         if (hasSize()) {
957            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(4, getSize());
958         }
959         if (hasAttachment()) {
960            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(5, getAttachment());
961         }
962         if (hasRedeliveries()) {
963            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getRedeliveries());
964         }
965         if (hasExpiration()) {
966            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(7, getExpiration());
967         }
968         if (hasMessageLocator()) {
969            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(8, getMessageLocator());
970         }
971         if (hasSender()) {
972            for (org.fusesource.hawtbuf.Buffer i : getSenderList()) {
973               size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(9, i);
974            }
975         }
976         return size;
977      }
978
979      public boolean equals(Object obj) {
980         if( obj==this )
981            return true;
982         
983         if( obj==null || obj.getClass()!=Buffer.class )
984            return false;
985         
986         return equals((Buffer)obj);
987      }
988      
989      public boolean equals(Buffer obj) {
990         return toUnframedBuffer().equals(obj.toUnframedBuffer());
991      }
992      
993      public int hashCode() {
994         if( hashCode==0 ) {
995         hashCode=2000715872 ^ toUnframedBuffer().hashCode();
996         }
997         return hashCode;
998      }
999      
1000      public boolean frozen() {
1001         return true;
1002      }
1003   }
1004
1005}
1006