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               break;
486            }
487            case 8:
488               setQueueKey(input.readInt64());
489               break;
490            case 16:
491               setQueueSeq(input.readInt64());
492               break;
493            case 24:
494               setMessageKey(input.readInt64());
495               break;
496            case 32:
497               setSize(input.readInt32());
498               break;
499            case 42:
500               setAttachment(input.readBytes());
501               break;
502            case 48:
503               setRedeliveries(input.readInt32());
504               break;
505            case 56:
506               setExpiration(input.readSInt64());
507               break;
508            case 66:
509               setMessageLocator(input.readBytes());
510               break;
511            case 74:
512               createSenderList().add(input.readBytes());
513               break;
514            }
515         }
516      }
517      public boolean equals(Object obj) {
518         if( obj==this )
519            return true;
520         
521         if( obj==null || obj.getClass()!=Bean.class )
522            return false;
523         
524         return equals((Bean)obj);
525      }
526      
527      public boolean equals(Bean obj) {
528         if (hasQueueKey() ^ obj.hasQueueKey() ) 
529            return false;
530         if (hasQueueKey() && ( getQueueKey()!=obj.getQueueKey() ))
531            return false;
532         if (hasQueueSeq() ^ obj.hasQueueSeq() ) 
533            return false;
534         if (hasQueueSeq() && ( getQueueSeq()!=obj.getQueueSeq() ))
535            return false;
536         if (hasMessageKey() ^ obj.hasMessageKey() ) 
537            return false;
538         if (hasMessageKey() && ( getMessageKey()!=obj.getMessageKey() ))
539            return false;
540         if (hasSize() ^ obj.hasSize() ) 
541            return false;
542         if (hasSize() && ( getSize()!=obj.getSize() ))
543            return false;
544         if (hasAttachment() ^ obj.hasAttachment() ) 
545            return false;
546         if (hasAttachment() && ( !getAttachment().equals(obj.getAttachment()) ))
547            return false;
548         if (hasRedeliveries() ^ obj.hasRedeliveries() ) 
549            return false;
550         if (hasRedeliveries() && ( getRedeliveries()!=obj.getRedeliveries() ))
551            return false;
552         if (hasExpiration() ^ obj.hasExpiration() ) 
553            return false;
554         if (hasExpiration() && ( getExpiration()!=obj.getExpiration() ))
555            return false;
556         if (hasMessageLocator() ^ obj.hasMessageLocator() ) 
557            return false;
558         if (hasMessageLocator() && ( !getMessageLocator().equals(obj.getMessageLocator()) ))
559            return false;
560         if (hasSender() ^ obj.hasSender() ) 
561            return false;
562         if (hasSender() && ( !getSenderList().equals(obj.getSenderList()) ))
563            return false;
564         return true;
565      }
566      
567      public int hashCode() {
568         int rc=2066384;
569         if (hasQueueKey()) {
570            rc ^= ( -1099854930^(new Long(getQueueKey())).hashCode() );
571         }
572         if (hasQueueSeq()) {
573            rc ^= ( -1099847250^(new Long(getQueueSeq())).hashCode() );
574         }
575         if (hasMessageKey()) {
576            rc ^= ( 302723320^(new Long(getMessageKey())).hashCode() );
577         }
578         if (hasSize()) {
579            rc ^= ( 2577441^getSize() );
580         }
581         if (hasAttachment()) {
582            rc ^= ( 29963587^getAttachment().hashCode() );
583         }
584         if (hasRedeliveries()) {
585            rc ^= ( 1969176101^getRedeliveries() );
586         }
587         if (hasExpiration()) {
588            rc ^= ( 1155999439^(new Long(getExpiration())).hashCode() );
589         }
590         if (hasMessageLocator()) {
591            rc ^= ( 193493679^getMessageLocator().hashCode() );
592         }
593         if (hasSender()) {
594            rc ^= ( -1822095787^getSenderList().hashCode() );
595         }
596         return rc;
597      }
598      
599      public Bean mergeFrom(Getter other) {
600         copyCheck();
601         if (other.hasQueueKey()) {
602            setQueueKey(other.getQueueKey());
603         }
604         if (other.hasQueueSeq()) {
605            setQueueSeq(other.getQueueSeq());
606         }
607         if (other.hasMessageKey()) {
608            setMessageKey(other.getMessageKey());
609         }
610         if (other.hasSize()) {
611            setSize(other.getSize());
612         }
613         if (other.hasAttachment()) {
614            setAttachment(other.getAttachment());
615         }
616         if (other.hasRedeliveries()) {
617            setRedeliveries(other.getRedeliveries());
618         }
619         if (other.hasExpiration()) {
620            setExpiration(other.getExpiration());
621         }
622         if (other.hasMessageLocator()) {
623            setMessageLocator(other.getMessageLocator());
624         }
625         if (other.hasSender()) {
626            getSenderList().addAll(other.getSenderList());
627         }
628         return this;
629      }
630
631      public void clear() {
632         clearQueueKey();
633         clearQueueSeq();
634         clearMessageKey();
635         clearSize();
636         clearAttachment();
637         clearRedeliveries();
638         clearExpiration();
639         clearMessageLocator();
640         clearSender();
641      }
642
643      public void readExternal(java.io.DataInput in) throws java.io.IOException {
644         assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
645         bean = this;
646         frozen = null;
647         f_queueKey = in.readLong();
648         b_queueKey = true;
649         f_queueSeq = in.readLong();
650         b_queueSeq = true;
651         f_messageKey = in.readLong();
652         b_messageKey = true;
653         f_size = in.readInt();
654         b_size = true;
655         {
656            int size = in.readInt();
657            if( size>=0 ) {
658               byte b[] = new byte[size];
659               in.readFully(b);
660               f_attachment = new org.fusesource.hawtbuf.Buffer(b);
661            } else {
662               f_attachment = null;
663            }
664         }
665         f_redeliveries = in.readInt();
666         b_redeliveries = true;
667         f_expiration = in.readLong();
668         b_expiration = true;
669         {
670            int size = in.readInt();
671            if( size>=0 ) {
672               byte b[] = new byte[size];
673               in.readFully(b);
674               f_messageLocator = new org.fusesource.hawtbuf.Buffer(b);
675            } else {
676               f_messageLocator = null;
677            }
678         }
679         {
680            int size = in.readShort();
681            if( size>=0 ) {
682               f_sender = new java.util.ArrayList<org.fusesource.hawtbuf.Buffer>(size);
683               for(int i=0; i<size; i++) {
684                  byte b[] = new byte[in.readInt()];
685                  in.readFully(b);
686                  f_sender.add(new org.fusesource.hawtbuf.Buffer(b));
687               }
688            } else {
689               f_sender = null;
690            }
691         }
692      }
693
694      public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
695         out.writeLong(bean.f_queueKey);
696         out.writeLong(bean.f_queueSeq);
697         out.writeLong(bean.f_messageKey);
698         out.writeInt(bean.f_size);
699         if( bean.f_attachment!=null ) {
700            out.writeInt(bean.f_attachment.getLength());
701            out.write(bean.f_attachment.getData(), bean.f_attachment.getOffset(), bean.f_attachment.getLength());
702         } else {
703            out.writeInt(-1);
704         }
705         out.writeInt(bean.f_redeliveries);
706         out.writeLong(bean.f_expiration);
707         if( bean.f_messageLocator!=null ) {
708            out.writeInt(bean.f_messageLocator.getLength());
709            out.write(bean.f_messageLocator.getData(), bean.f_messageLocator.getOffset(), bean.f_messageLocator.getLength());
710         } else {
711            out.writeInt(-1);
712         }
713         if( bean.f_sender!=null ) {
714            out.writeShort(bean.f_sender.size());
715            for(org.fusesource.hawtbuf.Buffer o : bean.f_sender) {
716               out.writeInt(o.getLength());
717               out.write(o.getData(), o.getOffset(), o.getLength());
718            }
719         } else {
720            out.writeShort(-1);
721         }
722      }
723
724   }
725
726   static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer<QueueEntryPB.Bean, QueueEntryPB.Buffer>, Getter {
727
728      private Bean bean;
729      private org.fusesource.hawtbuf.Buffer buffer;
730      private int size=-1;
731      private int hashCode;
732
733      private Buffer(org.fusesource.hawtbuf.Buffer buffer) {
734         this.buffer = buffer;
735      }
736
737      private Buffer(Bean bean) {
738         this.bean = bean;
739      }
740
741      public Bean copy() {
742         return bean().copy();
743      }
744
745      public Buffer freeze() {
746         return this;
747      }
748
749      private Bean bean() {
750         if (bean == null) {
751            try {
752               bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer));
753               bean.frozen=this;
754            } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) {
755               throw new RuntimeException(e);
756            } catch (java.io.IOException e) {
757               throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
758            }
759         }
760         return bean;
761      }
762
763      public String toString() {
764         return bean().toString();
765      }
766
767      public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
768         return bean().toString(sb, prefix);
769      }
770
771      // required int64 queueKey = 1;
772      public boolean hasQueueKey() {
773         return bean().hasQueueKey();
774      }
775
776      public long getQueueKey() {
777         return bean().getQueueKey();
778      }
779
780      // required int64 queueSeq = 2;
781      public boolean hasQueueSeq() {
782         return bean().hasQueueSeq();
783      }
784
785      public long getQueueSeq() {
786         return bean().getQueueSeq();
787      }
788
789      // required int64 messageKey = 3;
790      public boolean hasMessageKey() {
791         return bean().hasMessageKey();
792      }
793
794      public long getMessageKey() {
795         return bean().getMessageKey();
796      }
797
798      // optional int32 size = 4;
799      public boolean hasSize() {
800         return bean().hasSize();
801      }
802
803      public int getSize() {
804         return bean().getSize();
805      }
806
807      // optional bytes attachment = 5;
808      public boolean hasAttachment() {
809         return bean().hasAttachment();
810      }
811
812      public org.fusesource.hawtbuf.Buffer getAttachment() {
813         return bean().getAttachment();
814      }
815
816      // optional int32 redeliveries = 6;
817      public boolean hasRedeliveries() {
818         return bean().hasRedeliveries();
819      }
820
821      public int getRedeliveries() {
822         return bean().getRedeliveries();
823      }
824
825      // optional sint64 expiration = 7;
826      public boolean hasExpiration() {
827         return bean().hasExpiration();
828      }
829
830      public long getExpiration() {
831         return bean().getExpiration();
832      }
833
834      // optional bytes messageLocator = 8;
835      public boolean hasMessageLocator() {
836         return bean().hasMessageLocator();
837      }
838
839      public org.fusesource.hawtbuf.Buffer getMessageLocator() {
840         return bean().getMessageLocator();
841      }
842
843      // repeated bytes sender = 9;
844      public boolean hasSender() {
845         return bean().hasSender();
846      }
847
848      public java.util.List<org.fusesource.hawtbuf.Buffer> getSenderList() {
849         return bean().getSenderList();
850      }
851
852      public int getSenderCount() {
853         return bean().getSenderCount();
854      }
855
856      public org.fusesource.hawtbuf.Buffer getSender(int index) {
857         return bean().getSender(index);
858      }
859
860      public org.fusesource.hawtbuf.Buffer toUnframedBuffer() {
861         if( buffer !=null ) {
862            return buffer;
863         }
864         return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this);
865      }
866
867      public org.fusesource.hawtbuf.Buffer toFramedBuffer() {
868         return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this);
869      }
870
871      public byte[] toUnframedByteArray() {
872         return toUnframedBuffer().toByteArray();
873      }
874
875      public byte[] toFramedByteArray() {
876         return toFramedBuffer().toByteArray();
877      }
878
879      public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
880         output.writeRawVarint32(serializedSizeUnframed());
881         writeUnframed(output);
882      }
883
884      public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
885         org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
886         writeFramed(codedOutput);
887         codedOutput.flush();
888      }
889
890      public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
891         org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
892         writeUnframed(codedOutput);
893         codedOutput.flush();
894      }
895
896      public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
897         if (buffer == null) {
898            int size = serializedSizeUnframed();
899            buffer = output.getNextBuffer(size);
900            org.fusesource.hawtbuf.proto.CodedOutputStream original=null;
901            if( buffer == null ) {
902               buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]);
903               original = output;
904               output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer);
905            }
906            output.writeInt64(1, bean.getQueueKey());
907            output.writeInt64(2, bean.getQueueSeq());
908            output.writeInt64(3, bean.getMessageKey());
909            if (bean.hasSize()) {
910               output.writeInt32(4, bean.getSize());
911            }
912            if (bean.hasAttachment()) {
913               output.writeBytes(5, bean.getAttachment());
914            }
915            if (bean.hasRedeliveries()) {
916               output.writeInt32(6, bean.getRedeliveries());
917            }
918            if (bean.hasExpiration()) {
919               output.writeSInt64(7, bean.getExpiration());
920            }
921            if (bean.hasMessageLocator()) {
922               output.writeBytes(8, bean.getMessageLocator());
923            }
924            if (bean.hasSender()) {
925               for (org.fusesource.hawtbuf.Buffer i : bean.getSenderList()) {
926                  output.writeBytes(9, i);
927               }
928            }
929            if( original !=null ) {
930               output.checkNoSpaceLeft();
931               output = original;
932               output.writeRawBytes(buffer);
933            }
934         } else {
935            output.writeRawBytes(buffer);
936         }
937      }
938
939      public int serializedSizeFramed() {
940         int t = serializedSizeUnframed();
941         return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t;
942      }
943
944      public int serializedSizeUnframed() {
945         if (buffer != null) {
946            return buffer.length;
947         }
948         if (size != -1)
949            return size;
950
951         size = 0;
952         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getQueueKey());
953         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(2, getQueueSeq());
954         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(3, getMessageKey());
955         if (hasSize()) {
956            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(4, getSize());
957         }
958         if (hasAttachment()) {
959            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(5, getAttachment());
960         }
961         if (hasRedeliveries()) {
962            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getRedeliveries());
963         }
964         if (hasExpiration()) {
965            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(7, getExpiration());
966         }
967         if (hasMessageLocator()) {
968            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(8, getMessageLocator());
969         }
970         if (hasSender()) {
971            for (org.fusesource.hawtbuf.Buffer i : getSenderList()) {
972               size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(9, i);
973            }
974         }
975         return size;
976      }
977
978      public boolean equals(Object obj) {
979         if( obj==this )
980            return true;
981         
982         if( obj==null || obj.getClass()!=Buffer.class )
983            return false;
984         
985         return equals((Buffer)obj);
986      }
987      
988      public boolean equals(Buffer obj) {
989         return toUnframedBuffer().equals(obj.toUnframedBuffer());
990      }
991      
992      public int hashCode() {
993         if( hashCode==0 ) {
994         hashCode=2000715872 ^ toUnframedBuffer().hashCode();
995         }
996         return hashCode;
997      }
998      
999      public boolean frozen() {
1000         return true;
1001      }
1002   }
1003
1004}
1005