View Javadoc
1   // Generated by the protocol buffer compiler.  DO NOT EDIT!
2   // source: sample.proto
3   
4   package org.springframework.protobuf;
5   
6   /**
7    * Protobuf type {@code Msg}
8    */
9   public  final class Msg extends
10      com.google.protobuf.GeneratedMessage
11      implements MsgOrBuilder {
12    // Use Msg.newBuilder() to construct.
13    private Msg(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
14      super(builder);
15      this.unknownFields = builder.getUnknownFields();
16    }
17    private Msg(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
18  
19    private static final Msg defaultInstance;
20    public static Msg getDefaultInstance() {
21      return defaultInstance;
22    }
23  
24    public Msg getDefaultInstanceForType() {
25      return defaultInstance;
26    }
27  
28    private final com.google.protobuf.UnknownFieldSet unknownFields;
29    @java.lang.Override
30    public final com.google.protobuf.UnknownFieldSet
31        getUnknownFields() {
32      return this.unknownFields;
33    }
34    private Msg(
35        com.google.protobuf.CodedInputStream input,
36        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
37        throws com.google.protobuf.InvalidProtocolBufferException {
38      initFields();
39      int mutable_bitField0_ = 0;
40      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
41          com.google.protobuf.UnknownFieldSet.newBuilder();
42      try {
43        boolean done = false;
44        while (!done) {
45          int tag = input.readTag();
46          switch (tag) {
47            case 0:
48              done = true;
49              break;
50            default: {
51              if (!parseUnknownField(input, unknownFields,
52                                     extensionRegistry, tag)) {
53                done = true;
54              }
55              break;
56            }
57            case 10: {
58              bitField0_ |= 0x00000001;
59              foo_ = input.readBytes();
60              break;
61            }
62            case 18: {
63              org.springframework.protobuf.SecondMsg.Builder subBuilder = null;
64              if (((bitField0_ & 0x00000002) == 0x00000002)) {
65                subBuilder = blah_.toBuilder();
66              }
67              blah_ = input.readMessage(org.springframework.protobuf.SecondMsg.PARSER, extensionRegistry);
68              if (subBuilder != null) {
69                subBuilder.mergeFrom(blah_);
70                blah_ = subBuilder.buildPartial();
71              }
72              bitField0_ |= 0x00000002;
73              break;
74            }
75          }
76        }
77      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
78        throw e.setUnfinishedMessage(this);
79      } catch (java.io.IOException e) {
80        throw new com.google.protobuf.InvalidProtocolBufferException(
81            e.getMessage()).setUnfinishedMessage(this);
82      } finally {
83        this.unknownFields = unknownFields.build();
84        makeExtensionsImmutable();
85      }
86    }
87    public static final com.google.protobuf.Descriptors.Descriptor
88        getDescriptor() {
89      return org.springframework.protobuf.OuterSample.internal_static_Msg_descriptor;
90    }
91  
92    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
93        internalGetFieldAccessorTable() {
94      return org.springframework.protobuf.OuterSample.internal_static_Msg_fieldAccessorTable
95          .ensureFieldAccessorsInitialized(
96              org.springframework.protobuf.Msg.class, org.springframework.protobuf.Msg.Builder.class);
97    }
98  
99    public static com.google.protobuf.Parser<Msg> PARSER =
100       new com.google.protobuf.AbstractParser<Msg>() {
101     public Msg parsePartialFrom(
102         com.google.protobuf.CodedInputStream input,
103         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
104         throws com.google.protobuf.InvalidProtocolBufferException {
105       return new Msg(input, extensionRegistry);
106     }
107   };
108 
109   @java.lang.Override
110   public com.google.protobuf.Parser<Msg> getParserForType() {
111     return PARSER;
112   }
113 
114   private int bitField0_;
115   // optional string foo = 1;
116   public static final int FOO_FIELD_NUMBER = 1;
117   private java.lang.Object foo_;
118   /**
119    * <code>optional string foo = 1;</code>
120    */
121   public boolean hasFoo() {
122     return ((bitField0_ & 0x00000001) == 0x00000001);
123   }
124   /**
125    * <code>optional string foo = 1;</code>
126    */
127   public java.lang.String getFoo() {
128     java.lang.Object ref = foo_;
129     if (ref instanceof java.lang.String) {
130       return (java.lang.String) ref;
131     } else {
132       com.google.protobuf.ByteString bs = 
133           (com.google.protobuf.ByteString) ref;
134       java.lang.String s = bs.toStringUtf8();
135       if (bs.isValidUtf8()) {
136         foo_ = s;
137       }
138       return s;
139     }
140   }
141   /**
142    * <code>optional string foo = 1;</code>
143    */
144   public com.google.protobuf.ByteString
145       getFooBytes() {
146     java.lang.Object ref = foo_;
147     if (ref instanceof java.lang.String) {
148       com.google.protobuf.ByteString b = 
149           com.google.protobuf.ByteString.copyFromUtf8(
150               (java.lang.String) ref);
151       foo_ = b;
152       return b;
153     } else {
154       return (com.google.protobuf.ByteString) ref;
155     }
156   }
157 
158   // optional .SecondMsg blah = 2;
159   public static final int BLAH_FIELD_NUMBER = 2;
160   private org.springframework.protobuf.SecondMsg blah_;
161   /**
162    * <code>optional .SecondMsg blah = 2;</code>
163    */
164   public boolean hasBlah() {
165     return ((bitField0_ & 0x00000002) == 0x00000002);
166   }
167   /**
168    * <code>optional .SecondMsg blah = 2;</code>
169    */
170   public org.springframework.protobuf.SecondMsg getBlah() {
171     return blah_;
172   }
173   /**
174    * <code>optional .SecondMsg blah = 2;</code>
175    */
176   public org.springframework.protobuf.SecondMsgOrBuilder getBlahOrBuilder() {
177     return blah_;
178   }
179 
180   private void initFields() {
181     foo_ = "";
182     blah_ = org.springframework.protobuf.SecondMsg.getDefaultInstance();
183   }
184   private byte memoizedIsInitialized = -1;
185   public final boolean isInitialized() {
186     byte isInitialized = memoizedIsInitialized;
187     if (isInitialized != -1) return isInitialized == 1;
188 
189     memoizedIsInitialized = 1;
190     return true;
191   }
192 
193   public void writeTo(com.google.protobuf.CodedOutputStream output)
194                       throws java.io.IOException {
195     getSerializedSize();
196     if (((bitField0_ & 0x00000001) == 0x00000001)) {
197       output.writeBytes(1, getFooBytes());
198     }
199     if (((bitField0_ & 0x00000002) == 0x00000002)) {
200       output.writeMessage(2, blah_);
201     }
202     getUnknownFields().writeTo(output);
203   }
204 
205   private int memoizedSerializedSize = -1;
206   public int getSerializedSize() {
207     int size = memoizedSerializedSize;
208     if (size != -1) return size;
209 
210     size = 0;
211     if (((bitField0_ & 0x00000001) == 0x00000001)) {
212       size += com.google.protobuf.CodedOutputStream
213         .computeBytesSize(1, getFooBytes());
214     }
215     if (((bitField0_ & 0x00000002) == 0x00000002)) {
216       size += com.google.protobuf.CodedOutputStream
217         .computeMessageSize(2, blah_);
218     }
219     size += getUnknownFields().getSerializedSize();
220     memoizedSerializedSize = size;
221     return size;
222   }
223 
224   private static final long serialVersionUID = 0L;
225   @java.lang.Override
226   protected java.lang.Object writeReplace()
227       throws java.io.ObjectStreamException {
228     return super.writeReplace();
229   }
230 
231   public static org.springframework.protobuf.Msg parseFrom(
232       com.google.protobuf.ByteString data)
233       throws com.google.protobuf.InvalidProtocolBufferException {
234     return PARSER.parseFrom(data);
235   }
236   public static org.springframework.protobuf.Msg parseFrom(
237       com.google.protobuf.ByteString data,
238       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
239       throws com.google.protobuf.InvalidProtocolBufferException {
240     return PARSER.parseFrom(data, extensionRegistry);
241   }
242   public static org.springframework.protobuf.Msg parseFrom(byte[] data)
243       throws com.google.protobuf.InvalidProtocolBufferException {
244     return PARSER.parseFrom(data);
245   }
246   public static org.springframework.protobuf.Msg parseFrom(
247       byte[] data,
248       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
249       throws com.google.protobuf.InvalidProtocolBufferException {
250     return PARSER.parseFrom(data, extensionRegistry);
251   }
252   public static org.springframework.protobuf.Msg parseFrom(java.io.InputStream input)
253       throws java.io.IOException {
254     return PARSER.parseFrom(input);
255   }
256   public static org.springframework.protobuf.Msg parseFrom(
257       java.io.InputStream input,
258       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
259       throws java.io.IOException {
260     return PARSER.parseFrom(input, extensionRegistry);
261   }
262   public static org.springframework.protobuf.Msg parseDelimitedFrom(java.io.InputStream input)
263       throws java.io.IOException {
264     return PARSER.parseDelimitedFrom(input);
265   }
266   public static org.springframework.protobuf.Msg parseDelimitedFrom(
267       java.io.InputStream input,
268       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
269       throws java.io.IOException {
270     return PARSER.parseDelimitedFrom(input, extensionRegistry);
271   }
272   public static org.springframework.protobuf.Msg parseFrom(
273       com.google.protobuf.CodedInputStream input)
274       throws java.io.IOException {
275     return PARSER.parseFrom(input);
276   }
277   public static org.springframework.protobuf.Msg parseFrom(
278       com.google.protobuf.CodedInputStream input,
279       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
280       throws java.io.IOException {
281     return PARSER.parseFrom(input, extensionRegistry);
282   }
283 
284   public static Builder newBuilder() { return Builder.create(); }
285   public Builder newBuilderForType() { return newBuilder(); }
286   public static Builder newBuilder(org.springframework.protobuf.Msg prototype) {
287     return newBuilder().mergeFrom(prototype);
288   }
289   public Builder toBuilder() { return newBuilder(this); }
290 
291   @java.lang.Override
292   protected Builder newBuilderForType(
293       com.google.protobuf.GeneratedMessage.BuilderParent parent) {
294     Builder builder = new Builder(parent);
295     return builder;
296   }
297   /**
298    * Protobuf type {@code Msg}
299    */
300   public static final class Builder extends
301       com.google.protobuf.GeneratedMessage.Builder<Builder>
302      implements org.springframework.protobuf.MsgOrBuilder {
303     public static final com.google.protobuf.Descriptors.Descriptor
304         getDescriptor() {
305       return org.springframework.protobuf.OuterSample.internal_static_Msg_descriptor;
306     }
307 
308     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
309         internalGetFieldAccessorTable() {
310       return org.springframework.protobuf.OuterSample.internal_static_Msg_fieldAccessorTable
311           .ensureFieldAccessorsInitialized(
312               org.springframework.protobuf.Msg.class, org.springframework.protobuf.Msg.Builder.class);
313     }
314 
315     // Construct using org.springframework.protobuf.Msg.newBuilder()
316     private Builder() {
317       maybeForceBuilderInitialization();
318     }
319 
320     private Builder(
321         com.google.protobuf.GeneratedMessage.BuilderParent parent) {
322       super(parent);
323       maybeForceBuilderInitialization();
324     }
325     private void maybeForceBuilderInitialization() {
326       if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
327         getBlahFieldBuilder();
328       }
329     }
330     private static Builder create() {
331       return new Builder();
332     }
333 
334     public Builder clear() {
335       super.clear();
336       foo_ = "";
337       bitField0_ = (bitField0_ & ~0x00000001);
338       if (blahBuilder_ == null) {
339         blah_ = org.springframework.protobuf.SecondMsg.getDefaultInstance();
340       } else {
341         blahBuilder_.clear();
342       }
343       bitField0_ = (bitField0_ & ~0x00000002);
344       return this;
345     }
346 
347     public Builder clone() {
348       return create().mergeFrom(buildPartial());
349     }
350 
351     public com.google.protobuf.Descriptors.Descriptor
352         getDescriptorForType() {
353       return org.springframework.protobuf.OuterSample.internal_static_Msg_descriptor;
354     }
355 
356     public org.springframework.protobuf.Msg getDefaultInstanceForType() {
357       return org.springframework.protobuf.Msg.getDefaultInstance();
358     }
359 
360     public org.springframework.protobuf.Msg build() {
361       org.springframework.protobuf.Msg result = buildPartial();
362       if (!result.isInitialized()) {
363         throw newUninitializedMessageException(result);
364       }
365       return result;
366     }
367 
368     public org.springframework.protobuf.Msg buildPartial() {
369       org.springframework.protobuf.Msg result = new org.springframework.protobuf.Msg(this);
370       int from_bitField0_ = bitField0_;
371       int to_bitField0_ = 0;
372       if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
373         to_bitField0_ |= 0x00000001;
374       }
375       result.foo_ = foo_;
376       if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
377         to_bitField0_ |= 0x00000002;
378       }
379       if (blahBuilder_ == null) {
380         result.blah_ = blah_;
381       } else {
382         result.blah_ = blahBuilder_.build();
383       }
384       result.bitField0_ = to_bitField0_;
385       onBuilt();
386       return result;
387     }
388 
389     public Builder mergeFrom(com.google.protobuf.Message other) {
390       if (other instanceof org.springframework.protobuf.Msg) {
391         return mergeFrom((org.springframework.protobuf.Msg)other);
392       } else {
393         super.mergeFrom(other);
394         return this;
395       }
396     }
397 
398     public Builder mergeFrom(org.springframework.protobuf.Msg other) {
399       if (other == org.springframework.protobuf.Msg.getDefaultInstance()) return this;
400       if (other.hasFoo()) {
401         bitField0_ |= 0x00000001;
402         foo_ = other.foo_;
403         onChanged();
404       }
405       if (other.hasBlah()) {
406         mergeBlah(other.getBlah());
407       }
408       this.mergeUnknownFields(other.getUnknownFields());
409       return this;
410     }
411 
412     public final boolean isInitialized() {
413       return true;
414     }
415 
416     public Builder mergeFrom(
417         com.google.protobuf.CodedInputStream input,
418         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
419         throws java.io.IOException {
420       org.springframework.protobuf.Msg parsedMessage = null;
421       try {
422         parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
423       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
424         parsedMessage = (org.springframework.protobuf.Msg) e.getUnfinishedMessage();
425         throw e;
426       } finally {
427         if (parsedMessage != null) {
428           mergeFrom(parsedMessage);
429         }
430       }
431       return this;
432     }
433     private int bitField0_;
434 
435     // optional string foo = 1;
436     private java.lang.Object foo_ = "";
437     /**
438      * <code>optional string foo = 1;</code>
439      */
440     public boolean hasFoo() {
441       return ((bitField0_ & 0x00000001) == 0x00000001);
442     }
443     /**
444      * <code>optional string foo = 1;</code>
445      */
446     public java.lang.String getFoo() {
447       java.lang.Object ref = foo_;
448       if (!(ref instanceof java.lang.String)) {
449         java.lang.String s = ((com.google.protobuf.ByteString) ref)
450             .toStringUtf8();
451         foo_ = s;
452         return s;
453       } else {
454         return (java.lang.String) ref;
455       }
456     }
457     /**
458      * <code>optional string foo = 1;</code>
459      */
460     public com.google.protobuf.ByteString
461         getFooBytes() {
462       java.lang.Object ref = foo_;
463       if (ref instanceof String) {
464         com.google.protobuf.ByteString b = 
465             com.google.protobuf.ByteString.copyFromUtf8(
466                 (java.lang.String) ref);
467         foo_ = b;
468         return b;
469       } else {
470         return (com.google.protobuf.ByteString) ref;
471       }
472     }
473     /**
474      * <code>optional string foo = 1;</code>
475      */
476     public Builder setFoo(
477         java.lang.String value) {
478       if (value == null) {
479     throw new NullPointerException();
480   }
481   bitField0_ |= 0x00000001;
482       foo_ = value;
483       onChanged();
484       return this;
485     }
486     /**
487      * <code>optional string foo = 1;</code>
488      */
489     public Builder clearFoo() {
490       bitField0_ = (bitField0_ & ~0x00000001);
491       foo_ = getDefaultInstance().getFoo();
492       onChanged();
493       return this;
494     }
495     /**
496      * <code>optional string foo = 1;</code>
497      */
498     public Builder setFooBytes(
499         com.google.protobuf.ByteString value) {
500       if (value == null) {
501     throw new NullPointerException();
502   }
503   bitField0_ |= 0x00000001;
504       foo_ = value;
505       onChanged();
506       return this;
507     }
508 
509     // optional .SecondMsg blah = 2;
510     private org.springframework.protobuf.SecondMsg blah_ = org.springframework.protobuf.SecondMsg.getDefaultInstance();
511     private com.google.protobuf.SingleFieldBuilder<
512         org.springframework.protobuf.SecondMsg, org.springframework.protobuf.SecondMsg.Builder, org.springframework.protobuf.SecondMsgOrBuilder> blahBuilder_;
513     /**
514      * <code>optional .SecondMsg blah = 2;</code>
515      */
516     public boolean hasBlah() {
517       return ((bitField0_ & 0x00000002) == 0x00000002);
518     }
519     /**
520      * <code>optional .SecondMsg blah = 2;</code>
521      */
522     public org.springframework.protobuf.SecondMsg getBlah() {
523       if (blahBuilder_ == null) {
524         return blah_;
525       } else {
526         return blahBuilder_.getMessage();
527       }
528     }
529     /**
530      * <code>optional .SecondMsg blah = 2;</code>
531      */
532     public Builder setBlah(org.springframework.protobuf.SecondMsg value) {
533       if (blahBuilder_ == null) {
534         if (value == null) {
535           throw new NullPointerException();
536         }
537         blah_ = value;
538         onChanged();
539       } else {
540         blahBuilder_.setMessage(value);
541       }
542       bitField0_ |= 0x00000002;
543       return this;
544     }
545     /**
546      * <code>optional .SecondMsg blah = 2;</code>
547      */
548     public Builder setBlah(
549         org.springframework.protobuf.SecondMsg.Builder builderForValue) {
550       if (blahBuilder_ == null) {
551         blah_ = builderForValue.build();
552         onChanged();
553       } else {
554         blahBuilder_.setMessage(builderForValue.build());
555       }
556       bitField0_ |= 0x00000002;
557       return this;
558     }
559     /**
560      * <code>optional .SecondMsg blah = 2;</code>
561      */
562     public Builder mergeBlah(org.springframework.protobuf.SecondMsg value) {
563       if (blahBuilder_ == null) {
564         if (((bitField0_ & 0x00000002) == 0x00000002) &&
565             blah_ != org.springframework.protobuf.SecondMsg.getDefaultInstance()) {
566           blah_ =
567             org.springframework.protobuf.SecondMsg.newBuilder(blah_).mergeFrom(value).buildPartial();
568         } else {
569           blah_ = value;
570         }
571         onChanged();
572       } else {
573         blahBuilder_.mergeFrom(value);
574       }
575       bitField0_ |= 0x00000002;
576       return this;
577     }
578     /**
579      * <code>optional .SecondMsg blah = 2;</code>
580      */
581     public Builder clearBlah() {
582       if (blahBuilder_ == null) {
583         blah_ = org.springframework.protobuf.SecondMsg.getDefaultInstance();
584         onChanged();
585       } else {
586         blahBuilder_.clear();
587       }
588       bitField0_ = (bitField0_ & ~0x00000002);
589       return this;
590     }
591     /**
592      * <code>optional .SecondMsg blah = 2;</code>
593      */
594     public org.springframework.protobuf.SecondMsg.Builder getBlahBuilder() {
595       bitField0_ |= 0x00000002;
596       onChanged();
597       return getBlahFieldBuilder().getBuilder();
598     }
599     /**
600      * <code>optional .SecondMsg blah = 2;</code>
601      */
602     public org.springframework.protobuf.SecondMsgOrBuilder getBlahOrBuilder() {
603       if (blahBuilder_ != null) {
604         return blahBuilder_.getMessageOrBuilder();
605       } else {
606         return blah_;
607       }
608     }
609     /**
610      * <code>optional .SecondMsg blah = 2;</code>
611      */
612     private com.google.protobuf.SingleFieldBuilder<
613         org.springframework.protobuf.SecondMsg, org.springframework.protobuf.SecondMsg.Builder, org.springframework.protobuf.SecondMsgOrBuilder> 
614         getBlahFieldBuilder() {
615       if (blahBuilder_ == null) {
616         blahBuilder_ = new com.google.protobuf.SingleFieldBuilder<
617             org.springframework.protobuf.SecondMsg, org.springframework.protobuf.SecondMsg.Builder, org.springframework.protobuf.SecondMsgOrBuilder>(
618                 blah_,
619                 getParentForChildren(),
620                 isClean());
621         blah_ = null;
622       }
623       return blahBuilder_;
624     }
625 
626     // @@protoc_insertion_point(builder_scope:Msg)
627   }
628 
629   static {
630     defaultInstance = new Msg(true);
631     defaultInstance.initFields();
632   }
633 
634   // @@protoc_insertion_point(class_scope:Msg)
635 }
636