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               input.skipField(tag);
472               break;
473            }
474            case 8:
475               setMessageKey(input.readInt64());
476               break;
477            case 18:
478               setCodec(new org.fusesource.hawtbuf.AsciiBuffer(input.readBytes()));
479               break;
480            case 24:
481               setSize(input.readInt32());
482               break;
483            case 34:
484               setValue(input.readBytes());
485               break;
486            case 40:
487               setExpiration(input.readSInt64());
488               break;
489            case 48:
490               setCompression(input.readInt32());
491               break;
492            case 82:
493               setDirectData(input.readBytes());
494               break;
495            case 98:
496               setDirectFile(input.readBytes());
497               break;
498            case 104:
499               setDirectOffset(input.readInt64());
500               break;
501            case 112:
502               setDirectSize(input.readInt32());
503               break;
504            }
505         }
506      }
507      public boolean equals(Object obj) {
508         if( obj==this )
509            return true;
510         
511         if( obj==null || obj.getClass()!=Bean.class )
512            return false;
513         
514         return equals((Bean)obj);
515      }
516      
517      public boolean equals(Bean obj) {
518         if (hasMessageKey() ^ obj.hasMessageKey() ) 
519            return false;
520         if (hasMessageKey() && ( getMessageKey()!=obj.getMessageKey() ))
521            return false;
522         if (hasCodec() ^ obj.hasCodec() ) 
523            return false;
524         if (hasCodec() && ( !getCodec().equals(obj.getCodec()) ))
525            return false;
526         if (hasSize() ^ obj.hasSize() ) 
527            return false;
528         if (hasSize() && ( getSize()!=obj.getSize() ))
529            return false;
530         if (hasValue() ^ obj.hasValue() ) 
531            return false;
532         if (hasValue() && ( !getValue().equals(obj.getValue()) ))
533            return false;
534         if (hasExpiration() ^ obj.hasExpiration() ) 
535            return false;
536         if (hasExpiration() && ( getExpiration()!=obj.getExpiration() ))
537            return false;
538         if (hasCompression() ^ obj.hasCompression() ) 
539            return false;
540         if (hasCompression() && ( getCompression()!=obj.getCompression() ))
541            return false;
542         if (hasDirectData() ^ obj.hasDirectData() ) 
543            return false;
544         if (hasDirectData() && ( !getDirectData().equals(obj.getDirectData()) ))
545            return false;
546         if (hasDirectFile() ^ obj.hasDirectFile() ) 
547            return false;
548         if (hasDirectFile() && ( !getDirectFile().equals(obj.getDirectFile()) ))
549            return false;
550         if (hasDirectOffset() ^ obj.hasDirectOffset() ) 
551            return false;
552         if (hasDirectOffset() && ( getDirectOffset()!=obj.getDirectOffset() ))
553            return false;
554         if (hasDirectSize() ^ obj.hasDirectSize() ) 
555            return false;
556         if (hasDirectSize() && ( getDirectSize()!=obj.getDirectSize() ))
557            return false;
558         return true;
559      }
560      
561      public int hashCode() {
562         int rc=2066384;
563         if (hasMessageKey()) {
564            rc ^= ( 302723320^(new Long(getMessageKey())).hashCode() );
565         }
566         if (hasCodec()) {
567            rc ^= ( 65282038^getCodec().hashCode() );
568         }
569         if (hasSize()) {
570            rc ^= ( 2577441^getSize() );
571         }
572         if (hasValue()) {
573            rc ^= ( 82420049^getValue().hashCode() );
574         }
575         if (hasExpiration()) {
576            rc ^= ( 1155999439^(new Long(getExpiration())).hashCode() );
577         }
578         if (hasCompression()) {
579            rc ^= ( -1195114170^getCompression() );
580         }
581         if (hasDirectData()) {
582            rc ^= ( -2078163117^getDirectData().hashCode() );
583         }
584         if (hasDirectFile()) {
585            rc ^= ( -2078096091^getDirectFile().hashCode() );
586         }
587         if (hasDirectOffset()) {
588            rc ^= ( 364178940^(new Long(getDirectOffset())).hashCode() );
589         }
590         if (hasDirectSize()) {
591            rc ^= ( -2077708374^getDirectSize() );
592         }
593         return rc;
594      }
595      
596      public Bean mergeFrom(Getter other) {
597         copyCheck();
598         if (other.hasMessageKey()) {
599            setMessageKey(other.getMessageKey());
600         }
601         if (other.hasCodec()) {
602            setCodec(other.getCodec());
603         }
604         if (other.hasSize()) {
605            setSize(other.getSize());
606         }
607         if (other.hasValue()) {
608            setValue(other.getValue());
609         }
610         if (other.hasExpiration()) {
611            setExpiration(other.getExpiration());
612         }
613         if (other.hasCompression()) {
614            setCompression(other.getCompression());
615         }
616         if (other.hasDirectData()) {
617            setDirectData(other.getDirectData());
618         }
619         if (other.hasDirectFile()) {
620            setDirectFile(other.getDirectFile());
621         }
622         if (other.hasDirectOffset()) {
623            setDirectOffset(other.getDirectOffset());
624         }
625         if (other.hasDirectSize()) {
626            setDirectSize(other.getDirectSize());
627         }
628         return this;
629      }
630
631      public void clear() {
632         clearMessageKey();
633         clearCodec();
634         clearSize();
635         clearValue();
636         clearExpiration();
637         clearCompression();
638         clearDirectData();
639         clearDirectFile();
640         clearDirectOffset();
641         clearDirectSize();
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_messageKey = in.readLong();
649         b_messageKey = true;
650         {
651            int size = in.readInt();
652            if( size>=0 ) {
653               byte b[] = new byte[size];
654               in.readFully(b);
655               f_codec = new org.fusesource.hawtbuf.AsciiBuffer(b);
656            } else {
657               f_codec = null;
658            }
659         }
660         f_size = in.readInt();
661         b_size = true;
662         {
663            int size = in.readInt();
664            if( size>=0 ) {
665               byte b[] = new byte[size];
666               in.readFully(b);
667               f_value = new org.fusesource.hawtbuf.Buffer(b);
668            } else {
669               f_value = null;
670            }
671         }
672         f_expiration = in.readLong();
673         b_expiration = true;
674         f_compression = in.readInt();
675         b_compression = true;
676         {
677            int size = in.readInt();
678            if( size>=0 ) {
679               byte b[] = new byte[size];
680               in.readFully(b);
681               f_directData = new org.fusesource.hawtbuf.Buffer(b);
682            } else {
683               f_directData = null;
684            }
685         }
686         {
687            int size = in.readInt();
688            if( size>=0 ) {
689               byte b[] = new byte[size];
690               in.readFully(b);
691               f_directFile = new org.fusesource.hawtbuf.Buffer(b);
692            } else {
693               f_directFile = null;
694            }
695         }
696         f_directOffset = in.readLong();
697         b_directOffset = true;
698         f_directSize = in.readInt();
699         b_directSize = true;
700      }
701
702      public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
703         out.writeLong(bean.f_messageKey);
704         if( bean.f_codec!=null ) {
705            out.writeInt(bean.f_codec.getLength());
706            out.write(bean.f_codec.getData(), bean.f_codec.getOffset(), bean.f_codec.getLength());
707         } else {
708            out.writeInt(-1);
709         }
710         out.writeInt(bean.f_size);
711         if( bean.f_value!=null ) {
712            out.writeInt(bean.f_value.getLength());
713            out.write(bean.f_value.getData(), bean.f_value.getOffset(), bean.f_value.getLength());
714         } else {
715            out.writeInt(-1);
716         }
717         out.writeLong(bean.f_expiration);
718         out.writeInt(bean.f_compression);
719         if( bean.f_directData!=null ) {
720            out.writeInt(bean.f_directData.getLength());
721            out.write(bean.f_directData.getData(), bean.f_directData.getOffset(), bean.f_directData.getLength());
722         } else {
723            out.writeInt(-1);
724         }
725         if( bean.f_directFile!=null ) {
726            out.writeInt(bean.f_directFile.getLength());
727            out.write(bean.f_directFile.getData(), bean.f_directFile.getOffset(), bean.f_directFile.getLength());
728         } else {
729            out.writeInt(-1);
730         }
731         out.writeLong(bean.f_directOffset);
732         out.writeInt(bean.f_directSize);
733      }
734
735   }
736
737   static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer<MessagePB.Bean, MessagePB.Buffer>, Getter {
738
739      private Bean bean;
740      private org.fusesource.hawtbuf.Buffer buffer;
741      private int size=-1;
742      private int hashCode;
743
744      private Buffer(org.fusesource.hawtbuf.Buffer buffer) {
745         this.buffer = buffer;
746      }
747
748      private Buffer(Bean bean) {
749         this.bean = bean;
750      }
751
752      public Bean copy() {
753         return bean().copy();
754      }
755
756      public Buffer freeze() {
757         return this;
758      }
759
760      private Bean bean() {
761         if (bean == null) {
762            try {
763               bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer));
764               bean.frozen=this;
765            } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) {
766               throw new RuntimeException(e);
767            } catch (java.io.IOException e) {
768               throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
769            }
770         }
771         return bean;
772      }
773
774      public String toString() {
775         return bean().toString();
776      }
777
778      public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
779         return bean().toString(sb, prefix);
780      }
781
782      // required int64 messageKey = 1;
783      public boolean hasMessageKey() {
784         return bean().hasMessageKey();
785      }
786
787      public long getMessageKey() {
788         return bean().getMessageKey();
789      }
790
791      // required bytes codec = 2;
792      public boolean hasCodec() {
793         return bean().hasCodec();
794      }
795
796      public org.fusesource.hawtbuf.AsciiBuffer getCodec() {
797         return bean().getCodec();
798      }
799
800      // optional int32 size = 3;
801      public boolean hasSize() {
802         return bean().hasSize();
803      }
804
805      public int getSize() {
806         return bean().getSize();
807      }
808
809      // optional bytes value = 4;
810      public boolean hasValue() {
811         return bean().hasValue();
812      }
813
814      public org.fusesource.hawtbuf.Buffer getValue() {
815         return bean().getValue();
816      }
817
818      // optional sint64 expiration = 5;
819      public boolean hasExpiration() {
820         return bean().hasExpiration();
821      }
822
823      public long getExpiration() {
824         return bean().getExpiration();
825      }
826
827      // optional int32 compression = 6;
828      public boolean hasCompression() {
829         return bean().hasCompression();
830      }
831
832      public int getCompression() {
833         return bean().getCompression();
834      }
835
836      // optional bytes direct_data = 10;
837      public boolean hasDirectData() {
838         return bean().hasDirectData();
839      }
840
841      public org.fusesource.hawtbuf.Buffer getDirectData() {
842         return bean().getDirectData();
843      }
844
845      // optional bytes direct_file = 12;
846      public boolean hasDirectFile() {
847         return bean().hasDirectFile();
848      }
849
850      public org.fusesource.hawtbuf.Buffer getDirectFile() {
851         return bean().getDirectFile();
852      }
853
854      // optional int64 direct_offset = 13;
855      public boolean hasDirectOffset() {
856         return bean().hasDirectOffset();
857      }
858
859      public long getDirectOffset() {
860         return bean().getDirectOffset();
861      }
862
863      // optional int32 direct_size = 14;
864      public boolean hasDirectSize() {
865         return bean().hasDirectSize();
866      }
867
868      public int getDirectSize() {
869         return bean().getDirectSize();
870      }
871
872      public org.fusesource.hawtbuf.Buffer toUnframedBuffer() {
873         if( buffer !=null ) {
874            return buffer;
875         }
876         return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this);
877      }
878
879      public org.fusesource.hawtbuf.Buffer toFramedBuffer() {
880         return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this);
881      }
882
883      public byte[] toUnframedByteArray() {
884         return toUnframedBuffer().toByteArray();
885      }
886
887      public byte[] toFramedByteArray() {
888         return toFramedBuffer().toByteArray();
889      }
890
891      public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
892         output.writeRawVarint32(serializedSizeUnframed());
893         writeUnframed(output);
894      }
895
896      public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
897         org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
898         writeFramed(codedOutput);
899         codedOutput.flush();
900      }
901
902      public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
903         org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
904         writeUnframed(codedOutput);
905         codedOutput.flush();
906      }
907
908      public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
909         if (buffer == null) {
910            int size = serializedSizeUnframed();
911            buffer = output.getNextBuffer(size);
912            org.fusesource.hawtbuf.proto.CodedOutputStream original=null;
913            if( buffer == null ) {
914               buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]);
915               original = output;
916               output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer);
917            }
918            output.writeInt64(1, bean.getMessageKey());
919            output.writeBytes(2, bean.getCodec());
920            if (bean.hasSize()) {
921               output.writeInt32(3, bean.getSize());
922            }
923            if (bean.hasValue()) {
924               output.writeBytes(4, bean.getValue());
925            }
926            if (bean.hasExpiration()) {
927               output.writeSInt64(5, bean.getExpiration());
928            }
929            if (bean.hasCompression()) {
930               output.writeInt32(6, bean.getCompression());
931            }
932            if (bean.hasDirectData()) {
933               output.writeBytes(10, bean.getDirectData());
934            }
935            if (bean.hasDirectFile()) {
936               output.writeBytes(12, bean.getDirectFile());
937            }
938            if (bean.hasDirectOffset()) {
939               output.writeInt64(13, bean.getDirectOffset());
940            }
941            if (bean.hasDirectSize()) {
942               output.writeInt32(14, bean.getDirectSize());
943            }
944            if( original !=null ) {
945               output.checkNoSpaceLeft();
946               output = original;
947               output.writeRawBytes(buffer);
948            }
949         } else {
950            output.writeRawBytes(buffer);
951         }
952      }
953
954      public int serializedSizeFramed() {
955         int t = serializedSizeUnframed();
956         return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t;
957      }
958
959      public int serializedSizeUnframed() {
960         if (buffer != null) {
961            return buffer.length;
962         }
963         if (size != -1)
964            return size;
965
966         size = 0;
967         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getMessageKey());
968         size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getCodec());
969         if (hasSize()) {
970            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(3, getSize());
971         }
972         if (hasValue()) {
973            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(4, getValue());
974         }
975         if (hasExpiration()) {
976            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(5, getExpiration());
977         }
978         if (hasCompression()) {
979            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getCompression());
980         }
981         if (hasDirectData()) {
982            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(10, getDirectData());
983         }
984         if (hasDirectFile()) {
985            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(12, getDirectFile());
986         }
987         if (hasDirectOffset()) {
988            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(13, getDirectOffset());
989         }
990         if (hasDirectSize()) {
991            size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(14, getDirectSize());
992         }
993         return size;
994      }
995
996      public boolean equals(Object obj) {
997         if( obj==this )
998            return true;
999         
1000         if( obj==null || obj.getClass()!=Buffer.class )
1001            return false;
1002         
1003         return equals((Buffer)obj);
1004      }
1005      
1006      public boolean equals(Buffer obj) {
1007         return toUnframedBuffer().equals(obj.toUnframedBuffer());
1008      }
1009      
1010      public int hashCode() {
1011         if( hashCode==0 ) {
1012         hashCode=2000715872 ^ toUnframedBuffer().hashCode();
1013         }
1014         return hashCode;
1015      }
1016      
1017      public boolean frozen() {
1018         return true;
1019      }
1020   }
1021
1022}
1023