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