View Javadoc

1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License.
18   *
19   */
20  
21  // Generated by the protocol buffer compiler.  DO NOT EDIT!
22  // source: src/test/protobuf/calc.proto
23  
24  package org.apache.mina.generated.protoc;
25  
26  public final class Calc {
27      private Calc() {
28      }
29  
30      public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
31      }
32  
33      public interface ComputationOrBuilder extends com.google.protobuf.MessageOrBuilder {
34  
35          // required double x = 1;
36          /**
37           * <code>required double x = 1;</code>
38           */
39          boolean hasX();
40  
41          /**
42           * <code>required double x = 1;</code>
43           */
44          double getX();
45  
46          // required double y = 2;
47          /**
48           * <code>required double y = 2;</code>
49           */
50          boolean hasY();
51  
52          /**
53           * <code>required double y = 2;</code>
54           */
55          double getY();
56  
57          // required .tutorial.Computation.Operator operator = 3;
58          /**
59           * <code>required .tutorial.Computation.Operator operator = 3;</code>
60           */
61          boolean hasOperator();
62  
63          /**
64           * <code>required .tutorial.Computation.Operator operator = 3;</code>
65           */
66          org.apache.mina.generated.protoc.Calc.Computation.Operator getOperator();
67      }
68  
69      /**
70       * Protobuf type {@code tutorial.Computation}
71       */
72      public static final class Computation extends com.google.protobuf.GeneratedMessage implements ComputationOrBuilder {
73          // Use Computation.newBuilder() to construct.
74          private Computation(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
75              super(builder);
76              this.unknownFields = builder.getUnknownFields();
77          }
78  
79          private Computation(boolean noInit) {
80              this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance();
81          }
82  
83          private static final Computation defaultInstance;
84  
85          public static Computation getDefaultInstance() {
86              return defaultInstance;
87          }
88  
89          public Computation getDefaultInstanceForType() {
90              return defaultInstance;
91          }
92  
93          private final com.google.protobuf.UnknownFieldSet unknownFields;
94  
95          @java.lang.Override
96          public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
97              return this.unknownFields;
98          }
99  
100         private Computation(com.google.protobuf.CodedInputStream input,
101                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
102                 throws com.google.protobuf.InvalidProtocolBufferException {
103             initFields();
104             int mutable_bitField0_ = 0;
105             com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet
106                     .newBuilder();
107             try {
108                 boolean done = false;
109                 while (!done) {
110                     int tag = input.readTag();
111                     switch (tag) {
112                     case 0:
113                         done = true;
114                         break;
115                     default: {
116                         if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
117                             done = true;
118                         }
119                         break;
120                     }
121                     case 9: {
122                         bitField0_ |= 0x00000001;
123                         x_ = input.readDouble();
124                         break;
125                     }
126                     case 17: {
127                         bitField0_ |= 0x00000002;
128                         y_ = input.readDouble();
129                         break;
130                     }
131                     case 24: {
132                         int rawValue = input.readEnum();
133                         org.apache.mina.generated.protoc.Calc.Computation.Operator value = org.apache.mina.generated.protoc.Calc.Computation.Operator
134                                 .valueOf(rawValue);
135                         if (value == null) {
136                             unknownFields.mergeVarintField(3, rawValue);
137                         } else {
138                             bitField0_ |= 0x00000004;
139                             operator_ = value;
140                         }
141                         break;
142                     }
143                     }
144                 }
145             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
146                 throw e.setUnfinishedMessage(this);
147             } catch (java.io.IOException e) {
148                 throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this);
149             } finally {
150                 this.unknownFields = unknownFields.build();
151                 makeExtensionsImmutable();
152             }
153         }
154 
155         public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
156             return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Computation_descriptor;
157         }
158 
159         protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() {
160             return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Computation_fieldAccessorTable
161                     .ensureFieldAccessorsInitialized(org.apache.mina.generated.protoc.Calc.Computation.class,
162                             org.apache.mina.generated.protoc.Calc.Computation.Builder.class);
163         }
164 
165         public static com.google.protobuf.Parser<Computation> PARSER = new com.google.protobuf.AbstractParser<Computation>() {
166             public Computation parsePartialFrom(com.google.protobuf.CodedInputStream input,
167                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
168                     throws com.google.protobuf.InvalidProtocolBufferException {
169                 return new Computation(input, extensionRegistry);
170             }
171         };
172 
173         @java.lang.Override
174         public com.google.protobuf.Parser<Computation> getParserForType() {
175             return PARSER;
176         }
177 
178         /**
179          * Protobuf enum {@code tutorial.Computation.Operator}
180          */
181         public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
182             /**
183              * <code>PLUS = 0;</code>
184              */
185             PLUS(0, 0),
186             /**
187              * <code>MINUS = 1;</code>
188              */
189             MINUS(1, 1),
190             /**
191              * <code>TIMES = 2;</code>
192              */
193             TIMES(2, 2),
194             /**
195              * <code>DIVIDE = 3;</code>
196              */
197             DIVIDE(3, 3), ;
198 
199             /**
200              * <code>PLUS = 0;</code>
201              */
202             public static final int PLUS_VALUE = 0;
203 
204             /**
205              * <code>MINUS = 1;</code>
206              */
207             public static final int MINUS_VALUE = 1;
208 
209             /**
210              * <code>TIMES = 2;</code>
211              */
212             public static final int TIMES_VALUE = 2;
213 
214             /**
215              * <code>DIVIDE = 3;</code>
216              */
217             public static final int DIVIDE_VALUE = 3;
218 
219             public final int getNumber() {
220                 return value;
221             }
222 
223             public static Operator valueOf(int value) {
224                 switch (value) {
225                 case 0:
226                     return PLUS;
227                 case 1:
228                     return MINUS;
229                 case 2:
230                     return TIMES;
231                 case 3:
232                     return DIVIDE;
233                 default:
234                     return null;
235                 }
236             }
237 
238             public static com.google.protobuf.Internal.EnumLiteMap<Operator> internalGetValueMap() {
239                 return internalValueMap;
240             }
241 
242             private static com.google.protobuf.Internal.EnumLiteMap<Operator> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<Operator>() {
243                 public Operator findValueByNumber(int number) {
244                     return Operator.valueOf(number);
245                 }
246             };
247 
248             public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
249                 return getDescriptor().getValues().get(index);
250             }
251 
252             public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
253                 return getDescriptor();
254             }
255 
256             public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
257                 return org.apache.mina.generated.protoc.Calc.Computation.getDescriptor().getEnumTypes().get(0);
258             }
259 
260             private static final Operator[] VALUES = values();
261 
262             public static Operator valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
263                 if (desc.getType() != getDescriptor()) {
264                     throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
265                 }
266                 return VALUES[desc.getIndex()];
267             }
268 
269             private final int index;
270 
271             private final int value;
272 
273             private Operator(int index, int value) {
274                 this.index = index;
275                 this.value = value;
276             }
277 
278             // @@protoc_insertion_point(enum_scope:tutorial.Computation.Operator)
279         }
280 
281         private int bitField0_;
282 
283         // required double x = 1;
284         public static final int X_FIELD_NUMBER = 1;
285 
286         private double x_;
287 
288         /**
289          * <code>required double x = 1;</code>
290          */
291         public boolean hasX() {
292             return ((bitField0_ & 0x00000001) == 0x00000001);
293         }
294 
295         /**
296          * <code>required double x = 1;</code>
297          */
298         public double getX() {
299             return x_;
300         }
301 
302         // required double y = 2;
303         public static final int Y_FIELD_NUMBER = 2;
304 
305         private double y_;
306 
307         /**
308          * <code>required double y = 2;</code>
309          */
310         public boolean hasY() {
311             return ((bitField0_ & 0x00000002) == 0x00000002);
312         }
313 
314         /**
315          * <code>required double y = 2;</code>
316          */
317         public double getY() {
318             return y_;
319         }
320 
321         // required .tutorial.Computation.Operator operator = 3;
322         public static final int OPERATOR_FIELD_NUMBER = 3;
323 
324         private org.apache.mina.generated.protoc.Calc.Computation.Operator operator_;
325 
326         /**
327          * <code>required .tutorial.Computation.Operator operator = 3;</code>
328          */
329         public boolean hasOperator() {
330             return ((bitField0_ & 0x00000004) == 0x00000004);
331         }
332 
333         /**
334          * <code>required .tutorial.Computation.Operator operator = 3;</code>
335          */
336         public org.apache.mina.generated.protoc.Calc.Computation.Operator getOperator() {
337             return operator_;
338         }
339 
340         private void initFields() {
341             x_ = 0D;
342             y_ = 0D;
343             operator_ = org.apache.mina.generated.protoc.Calc.Computation.Operator.PLUS;
344         }
345 
346         private byte memoizedIsInitialized = -1;
347 
348         public final boolean isInitialized() {
349             byte isInitialized = memoizedIsInitialized;
350             if (isInitialized != -1)
351                 return isInitialized == 1;
352 
353             if (!hasX()) {
354                 memoizedIsInitialized = 0;
355                 return false;
356             }
357             if (!hasY()) {
358                 memoizedIsInitialized = 0;
359                 return false;
360             }
361             if (!hasOperator()) {
362                 memoizedIsInitialized = 0;
363                 return false;
364             }
365             memoizedIsInitialized = 1;
366             return true;
367         }
368 
369         public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
370             getSerializedSize();
371             if (((bitField0_ & 0x00000001) == 0x00000001)) {
372                 output.writeDouble(1, x_);
373             }
374             if (((bitField0_ & 0x00000002) == 0x00000002)) {
375                 output.writeDouble(2, y_);
376             }
377             if (((bitField0_ & 0x00000004) == 0x00000004)) {
378                 output.writeEnum(3, operator_.getNumber());
379             }
380             getUnknownFields().writeTo(output);
381         }
382 
383         private int memoizedSerializedSize = -1;
384 
385         public int getSerializedSize() {
386             int size = memoizedSerializedSize;
387             if (size != -1)
388                 return size;
389 
390             size = 0;
391             if (((bitField0_ & 0x00000001) == 0x00000001)) {
392                 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, x_);
393             }
394             if (((bitField0_ & 0x00000002) == 0x00000002)) {
395                 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, y_);
396             }
397             if (((bitField0_ & 0x00000004) == 0x00000004)) {
398                 size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, operator_.getNumber());
399             }
400             size += getUnknownFields().getSerializedSize();
401             memoizedSerializedSize = size;
402             return size;
403         }
404 
405         private static final long serialVersionUID = 0L;
406 
407         @java.lang.Override
408         protected java.lang.Object writeReplace() throws java.io.ObjectStreamException {
409             return super.writeReplace();
410         }
411 
412         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(com.google.protobuf.ByteString data)
413                 throws com.google.protobuf.InvalidProtocolBufferException {
414             return PARSER.parseFrom(data);
415         }
416 
417         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(com.google.protobuf.ByteString data,
418                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
419                 throws com.google.protobuf.InvalidProtocolBufferException {
420             return PARSER.parseFrom(data, extensionRegistry);
421         }
422 
423         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(byte[] data)
424                 throws com.google.protobuf.InvalidProtocolBufferException {
425             return PARSER.parseFrom(data);
426         }
427 
428         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(byte[] data,
429                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
430                 throws com.google.protobuf.InvalidProtocolBufferException {
431             return PARSER.parseFrom(data, extensionRegistry);
432         }
433 
434         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(java.io.InputStream input)
435                 throws java.io.IOException {
436             return PARSER.parseFrom(input);
437         }
438 
439         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(java.io.InputStream input,
440                 com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
441             return PARSER.parseFrom(input, extensionRegistry);
442         }
443 
444         public static org.apache.mina.generated.protoc.Calc.Computation parseDelimitedFrom(java.io.InputStream input)
445                 throws java.io.IOException {
446             return PARSER.parseDelimitedFrom(input);
447         }
448 
449         public static org.apache.mina.generated.protoc.Calc.Computation parseDelimitedFrom(java.io.InputStream input,
450                 com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
451             return PARSER.parseDelimitedFrom(input, extensionRegistry);
452         }
453 
454         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(
455                 com.google.protobuf.CodedInputStream input) throws java.io.IOException {
456             return PARSER.parseFrom(input);
457         }
458 
459         public static org.apache.mina.generated.protoc.Calc.Computation parseFrom(
460                 com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
461                 throws java.io.IOException {
462             return PARSER.parseFrom(input, extensionRegistry);
463         }
464 
465         public static Builder newBuilder() {
466             return Builder.create();
467         }
468 
469         public Builder newBuilderForType() {
470             return newBuilder();
471         }
472 
473         public static Builder newBuilder(org.apache.mina.generated.protoc.Calc.Computation prototype) {
474             return newBuilder().mergeFrom(prototype);
475         }
476 
477         public Builder toBuilder() {
478             return newBuilder(this);
479         }
480 
481         @java.lang.Override
482         protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
483             Builder builder = new Builder(parent);
484             return builder;
485         }
486 
487         /**
488          * Protobuf type {@code tutorial.Computation}
489          */
490         public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements
491                 org.apache.mina.generated.protoc.Calc.ComputationOrBuilder {
492             public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
493                 return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Computation_descriptor;
494             }
495 
496             protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() {
497                 return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Computation_fieldAccessorTable
498                         .ensureFieldAccessorsInitialized(org.apache.mina.generated.protoc.Calc.Computation.class,
499                                 org.apache.mina.generated.protoc.Calc.Computation.Builder.class);
500             }
501 
502             // Construct using org.apache.mina.generated.protoc.Calc.Computation.newBuilder()
503             private Builder() {
504                 maybeForceBuilderInitialization();
505             }
506 
507             private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
508                 super(parent);
509                 maybeForceBuilderInitialization();
510             }
511 
512             private void maybeForceBuilderInitialization() {
513                 if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
514                 }
515             }
516 
517             private static Builder create() {
518                 return new Builder();
519             }
520 
521             public Builder clear() {
522                 super.clear();
523                 x_ = 0D;
524                 bitField0_ = (bitField0_ & ~0x00000001);
525                 y_ = 0D;
526                 bitField0_ = (bitField0_ & ~0x00000002);
527                 operator_ = org.apache.mina.generated.protoc.Calc.Computation.Operator.PLUS;
528                 bitField0_ = (bitField0_ & ~0x00000004);
529                 return this;
530             }
531 
532             public Builder clone() {
533                 return create().mergeFrom(buildPartial());
534             }
535 
536             public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
537                 return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Computation_descriptor;
538             }
539 
540             public org.apache.mina.generated.protoc.Calc.Computation getDefaultInstanceForType() {
541                 return org.apache.mina.generated.protoc.Calc.Computation.getDefaultInstance();
542             }
543 
544             public org.apache.mina.generated.protoc.Calc.Computation build() {
545                 org.apache.mina.generated.protoc.Calc.Computation result = buildPartial();
546                 if (!result.isInitialized()) {
547                     throw newUninitializedMessageException(result);
548                 }
549                 return result;
550             }
551 
552             public org.apache.mina.generated.protoc.Calc.Computation buildPartial() {
553                 org.apache.mina.generated.protoc.Calc.Computation result = new org.apache.mina.generated.protoc.Calc.Computation(
554                         this);
555                 int from_bitField0_ = bitField0_;
556                 int to_bitField0_ = 0;
557                 if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
558                     to_bitField0_ |= 0x00000001;
559                 }
560                 result.x_ = x_;
561                 if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
562                     to_bitField0_ |= 0x00000002;
563                 }
564                 result.y_ = y_;
565                 if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
566                     to_bitField0_ |= 0x00000004;
567                 }
568                 result.operator_ = operator_;
569                 result.bitField0_ = to_bitField0_;
570                 onBuilt();
571                 return result;
572             }
573 
574             public Builder mergeFrom(com.google.protobuf.Message other) {
575                 if (other instanceof org.apache.mina.generated.protoc.Calc.Computation) {
576                     return mergeFrom((org.apache.mina.generated.protoc.Calc.Computation) other);
577                 } else {
578                     super.mergeFrom(other);
579                     return this;
580                 }
581             }
582 
583             public Builder mergeFrom(org.apache.mina.generated.protoc.Calc.Computation other) {
584                 if (other == org.apache.mina.generated.protoc.Calc.Computation.getDefaultInstance())
585                     return this;
586                 if (other.hasX()) {
587                     setX(other.getX());
588                 }
589                 if (other.hasY()) {
590                     setY(other.getY());
591                 }
592                 if (other.hasOperator()) {
593                     setOperator(other.getOperator());
594                 }
595                 this.mergeUnknownFields(other.getUnknownFields());
596                 return this;
597             }
598 
599             public final boolean isInitialized() {
600                 if (!hasX()) {
601 
602                     return false;
603                 }
604                 if (!hasY()) {
605 
606                     return false;
607                 }
608                 if (!hasOperator()) {
609 
610                     return false;
611                 }
612                 return true;
613             }
614 
615             public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
616                     com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
617                 org.apache.mina.generated.protoc.Calc.Computation parsedMessage = null;
618                 try {
619                     parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
620                 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
621                     parsedMessage = (org.apache.mina.generated.protoc.Calc.Computation) e.getUnfinishedMessage();
622                     throw e;
623                 } finally {
624                     if (parsedMessage != null) {
625                         mergeFrom(parsedMessage);
626                     }
627                 }
628                 return this;
629             }
630 
631             private int bitField0_;
632 
633             // required double x = 1;
634             private double x_;
635 
636             /**
637              * <code>required double x = 1;</code>
638              */
639             public boolean hasX() {
640                 return ((bitField0_ & 0x00000001) == 0x00000001);
641             }
642 
643             /**
644              * <code>required double x = 1;</code>
645              */
646             public double getX() {
647                 return x_;
648             }
649 
650             /**
651              * <code>required double x = 1;</code>
652              */
653             public Builder setX(double value) {
654                 bitField0_ |= 0x00000001;
655                 x_ = value;
656                 onChanged();
657                 return this;
658             }
659 
660             /**
661              * <code>required double x = 1;</code>
662              */
663             public Builder clearX() {
664                 bitField0_ = (bitField0_ & ~0x00000001);
665                 x_ = 0D;
666                 onChanged();
667                 return this;
668             }
669 
670             // required double y = 2;
671             private double y_;
672 
673             /**
674              * <code>required double y = 2;</code>
675              */
676             public boolean hasY() {
677                 return ((bitField0_ & 0x00000002) == 0x00000002);
678             }
679 
680             /**
681              * <code>required double y = 2;</code>
682              */
683             public double getY() {
684                 return y_;
685             }
686 
687             /**
688              * <code>required double y = 2;</code>
689              */
690             public Builder setY(double value) {
691                 bitField0_ |= 0x00000002;
692                 y_ = value;
693                 onChanged();
694                 return this;
695             }
696 
697             /**
698              * <code>required double y = 2;</code>
699              */
700             public Builder clearY() {
701                 bitField0_ = (bitField0_ & ~0x00000002);
702                 y_ = 0D;
703                 onChanged();
704                 return this;
705             }
706 
707             // required .tutorial.Computation.Operator operator = 3;
708             private org.apache.mina.generated.protoc.Calc.Computation.Operator operator_ = org.apache.mina.generated.protoc.Calc.Computation.Operator.PLUS;
709 
710             /**
711              * <code>required .tutorial.Computation.Operator operator = 3;</code>
712              */
713             public boolean hasOperator() {
714                 return ((bitField0_ & 0x00000004) == 0x00000004);
715             }
716 
717             /**
718              * <code>required .tutorial.Computation.Operator operator = 3;</code>
719              */
720             public org.apache.mina.generated.protoc.Calc.Computation.Operator getOperator() {
721                 return operator_;
722             }
723 
724             /**
725              * <code>required .tutorial.Computation.Operator operator = 3;</code>
726              */
727             public Builder setOperator(org.apache.mina.generated.protoc.Calc.Computation.Operator value) {
728                 if (value == null) {
729                     throw new NullPointerException();
730                 }
731                 bitField0_ |= 0x00000004;
732                 operator_ = value;
733                 onChanged();
734                 return this;
735             }
736 
737             /**
738              * <code>required .tutorial.Computation.Operator operator = 3;</code>
739              */
740             public Builder clearOperator() {
741                 bitField0_ = (bitField0_ & ~0x00000004);
742                 operator_ = org.apache.mina.generated.protoc.Calc.Computation.Operator.PLUS;
743                 onChanged();
744                 return this;
745             }
746 
747             // @@protoc_insertion_point(builder_scope:tutorial.Computation)
748         }
749 
750         static {
751             defaultInstance = new Computation(true);
752             defaultInstance.initFields();
753         }
754 
755         // @@protoc_insertion_point(class_scope:tutorial.Computation)
756     }
757 
758     public interface ResultOrBuilder extends com.google.protobuf.MessageOrBuilder {
759 
760         // required double z = 1;
761         /**
762          * <code>required double z = 1;</code>
763          */
764         boolean hasZ();
765 
766         /**
767          * <code>required double z = 1;</code>
768          */
769         double getZ();
770     }
771 
772     /**
773      * Protobuf type {@code tutorial.Result}
774      */
775     public static final class Result extends com.google.protobuf.GeneratedMessage implements ResultOrBuilder {
776         // Use Result.newBuilder() to construct.
777         private Result(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
778             super(builder);
779             this.unknownFields = builder.getUnknownFields();
780         }
781 
782         private Result(boolean noInit) {
783             this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance();
784         }
785 
786         private static final Result defaultInstance;
787 
788         public static Result getDefaultInstance() {
789             return defaultInstance;
790         }
791 
792         public Result getDefaultInstanceForType() {
793             return defaultInstance;
794         }
795 
796         private final com.google.protobuf.UnknownFieldSet unknownFields;
797 
798         @java.lang.Override
799         public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
800             return this.unknownFields;
801         }
802 
803         private Result(com.google.protobuf.CodedInputStream input,
804                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
805                 throws com.google.protobuf.InvalidProtocolBufferException {
806             initFields();
807             int mutable_bitField0_ = 0;
808             com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet
809                     .newBuilder();
810             try {
811                 boolean done = false;
812                 while (!done) {
813                     int tag = input.readTag();
814                     switch (tag) {
815                     case 0:
816                         done = true;
817                         break;
818                     default: {
819                         if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
820                             done = true;
821                         }
822                         break;
823                     }
824                     case 9: {
825                         bitField0_ |= 0x00000001;
826                         z_ = input.readDouble();
827                         break;
828                     }
829                     }
830                 }
831             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
832                 throw e.setUnfinishedMessage(this);
833             } catch (java.io.IOException e) {
834                 throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this);
835             } finally {
836                 this.unknownFields = unknownFields.build();
837                 makeExtensionsImmutable();
838             }
839         }
840 
841         public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
842             return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Result_descriptor;
843         }
844 
845         protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() {
846             return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Result_fieldAccessorTable
847                     .ensureFieldAccessorsInitialized(org.apache.mina.generated.protoc.Calc.Result.class,
848                             org.apache.mina.generated.protoc.Calc.Result.Builder.class);
849         }
850 
851         public static com.google.protobuf.Parser<Result> PARSER = new com.google.protobuf.AbstractParser<Result>() {
852             public Result parsePartialFrom(com.google.protobuf.CodedInputStream input,
853                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
854                     throws com.google.protobuf.InvalidProtocolBufferException {
855                 return new Result(input, extensionRegistry);
856             }
857         };
858 
859         @java.lang.Override
860         public com.google.protobuf.Parser<Result> getParserForType() {
861             return PARSER;
862         }
863 
864         private int bitField0_;
865 
866         // required double z = 1;
867         public static final int Z_FIELD_NUMBER = 1;
868 
869         private double z_;
870 
871         /**
872          * <code>required double z = 1;</code>
873          */
874         public boolean hasZ() {
875             return ((bitField0_ & 0x00000001) == 0x00000001);
876         }
877 
878         /**
879          * <code>required double z = 1;</code>
880          */
881         public double getZ() {
882             return z_;
883         }
884 
885         private void initFields() {
886             z_ = 0D;
887         }
888 
889         private byte memoizedIsInitialized = -1;
890 
891         public final boolean isInitialized() {
892             byte isInitialized = memoizedIsInitialized;
893             if (isInitialized != -1)
894                 return isInitialized == 1;
895 
896             if (!hasZ()) {
897                 memoizedIsInitialized = 0;
898                 return false;
899             }
900             memoizedIsInitialized = 1;
901             return true;
902         }
903 
904         public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
905             getSerializedSize();
906             if (((bitField0_ & 0x00000001) == 0x00000001)) {
907                 output.writeDouble(1, z_);
908             }
909             getUnknownFields().writeTo(output);
910         }
911 
912         private int memoizedSerializedSize = -1;
913 
914         public int getSerializedSize() {
915             int size = memoizedSerializedSize;
916             if (size != -1)
917                 return size;
918 
919             size = 0;
920             if (((bitField0_ & 0x00000001) == 0x00000001)) {
921                 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, z_);
922             }
923             size += getUnknownFields().getSerializedSize();
924             memoizedSerializedSize = size;
925             return size;
926         }
927 
928         private static final long serialVersionUID = 0L;
929 
930         @java.lang.Override
931         protected java.lang.Object writeReplace() throws java.io.ObjectStreamException {
932             return super.writeReplace();
933         }
934 
935         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(com.google.protobuf.ByteString data)
936                 throws com.google.protobuf.InvalidProtocolBufferException {
937             return PARSER.parseFrom(data);
938         }
939 
940         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(com.google.protobuf.ByteString data,
941                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
942                 throws com.google.protobuf.InvalidProtocolBufferException {
943             return PARSER.parseFrom(data, extensionRegistry);
944         }
945 
946         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(byte[] data)
947                 throws com.google.protobuf.InvalidProtocolBufferException {
948             return PARSER.parseFrom(data);
949         }
950 
951         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(byte[] data,
952                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
953                 throws com.google.protobuf.InvalidProtocolBufferException {
954             return PARSER.parseFrom(data, extensionRegistry);
955         }
956 
957         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(java.io.InputStream input)
958                 throws java.io.IOException {
959             return PARSER.parseFrom(input);
960         }
961 
962         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(java.io.InputStream input,
963                 com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
964             return PARSER.parseFrom(input, extensionRegistry);
965         }
966 
967         public static org.apache.mina.generated.protoc.Calc.Result parseDelimitedFrom(java.io.InputStream input)
968                 throws java.io.IOException {
969             return PARSER.parseDelimitedFrom(input);
970         }
971 
972         public static org.apache.mina.generated.protoc.Calc.Result parseDelimitedFrom(java.io.InputStream input,
973                 com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
974             return PARSER.parseDelimitedFrom(input, extensionRegistry);
975         }
976 
977         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(com.google.protobuf.CodedInputStream input)
978                 throws java.io.IOException {
979             return PARSER.parseFrom(input);
980         }
981 
982         public static org.apache.mina.generated.protoc.Calc.Result parseFrom(
983                 com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
984                 throws java.io.IOException {
985             return PARSER.parseFrom(input, extensionRegistry);
986         }
987 
988         public static Builder newBuilder() {
989             return Builder.create();
990         }
991 
992         public Builder newBuilderForType() {
993             return newBuilder();
994         }
995 
996         public static Builder newBuilder(org.apache.mina.generated.protoc.Calc.Result prototype) {
997             return newBuilder().mergeFrom(prototype);
998         }
999 
1000         public Builder toBuilder() {
1001             return newBuilder(this);
1002         }
1003 
1004         @java.lang.Override
1005         protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
1006             Builder builder = new Builder(parent);
1007             return builder;
1008         }
1009 
1010         /**
1011          * Protobuf type {@code tutorial.Result}
1012          */
1013         public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements
1014                 org.apache.mina.generated.protoc.Calc.ResultOrBuilder {
1015             public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1016                 return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Result_descriptor;
1017             }
1018 
1019             protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() {
1020                 return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Result_fieldAccessorTable
1021                         .ensureFieldAccessorsInitialized(org.apache.mina.generated.protoc.Calc.Result.class,
1022                                 org.apache.mina.generated.protoc.Calc.Result.Builder.class);
1023             }
1024 
1025             // Construct using org.apache.mina.generated.protoc.Calc.Result.newBuilder()
1026             private Builder() {
1027                 maybeForceBuilderInitialization();
1028             }
1029 
1030             private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
1031                 super(parent);
1032                 maybeForceBuilderInitialization();
1033             }
1034 
1035             private void maybeForceBuilderInitialization() {
1036                 if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
1037                 }
1038             }
1039 
1040             private static Builder create() {
1041                 return new Builder();
1042             }
1043 
1044             public Builder clear() {
1045                 super.clear();
1046                 z_ = 0D;
1047                 bitField0_ = (bitField0_ & ~0x00000001);
1048                 return this;
1049             }
1050 
1051             public Builder clone() {
1052                 return create().mergeFrom(buildPartial());
1053             }
1054 
1055             public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1056                 return org.apache.mina.generated.protoc.Calc.internal_static_tutorial_Result_descriptor;
1057             }
1058 
1059             public org.apache.mina.generated.protoc.Calc.Result getDefaultInstanceForType() {
1060                 return org.apache.mina.generated.protoc.Calc.Result.getDefaultInstance();
1061             }
1062 
1063             public org.apache.mina.generated.protoc.Calc.Result build() {
1064                 org.apache.mina.generated.protoc.Calc.Result result = buildPartial();
1065                 if (!result.isInitialized()) {
1066                     throw newUninitializedMessageException(result);
1067                 }
1068                 return result;
1069             }
1070 
1071             public org.apache.mina.generated.protoc.Calc.Result buildPartial() {
1072                 org.apache.mina.generated.protoc.Calc.Result result = new org.apache.mina.generated.protoc.Calc.Result(
1073                         this);
1074                 int from_bitField0_ = bitField0_;
1075                 int to_bitField0_ = 0;
1076                 if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
1077                     to_bitField0_ |= 0x00000001;
1078                 }
1079                 result.z_ = z_;
1080                 result.bitField0_ = to_bitField0_;
1081                 onBuilt();
1082                 return result;
1083             }
1084 
1085             public Builder mergeFrom(com.google.protobuf.Message other) {
1086                 if (other instanceof org.apache.mina.generated.protoc.Calc.Result) {
1087                     return mergeFrom((org.apache.mina.generated.protoc.Calc.Result) other);
1088                 } else {
1089                     super.mergeFrom(other);
1090                     return this;
1091                 }
1092             }
1093 
1094             public Builder mergeFrom(org.apache.mina.generated.protoc.Calc.Result other) {
1095                 if (other == org.apache.mina.generated.protoc.Calc.Result.getDefaultInstance())
1096                     return this;
1097                 if (other.hasZ()) {
1098                     setZ(other.getZ());
1099                 }
1100                 this.mergeUnknownFields(other.getUnknownFields());
1101                 return this;
1102             }
1103 
1104             public final boolean isInitialized() {
1105                 if (!hasZ()) {
1106 
1107                     return false;
1108                 }
1109                 return true;
1110             }
1111 
1112             public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
1113                     com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
1114                 org.apache.mina.generated.protoc.Calc.Result parsedMessage = null;
1115                 try {
1116                     parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
1117                 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1118                     parsedMessage = (org.apache.mina.generated.protoc.Calc.Result) e.getUnfinishedMessage();
1119                     throw e;
1120                 } finally {
1121                     if (parsedMessage != null) {
1122                         mergeFrom(parsedMessage);
1123                     }
1124                 }
1125                 return this;
1126             }
1127 
1128             private int bitField0_;
1129 
1130             // required double z = 1;
1131             private double z_;
1132 
1133             /**
1134              * <code>required double z = 1;</code>
1135              */
1136             public boolean hasZ() {
1137                 return ((bitField0_ & 0x00000001) == 0x00000001);
1138             }
1139 
1140             /**
1141              * <code>required double z = 1;</code>
1142              */
1143             public double getZ() {
1144                 return z_;
1145             }
1146 
1147             /**
1148              * <code>required double z = 1;</code>
1149              */
1150             public Builder setZ(double value) {
1151                 bitField0_ |= 0x00000001;
1152                 z_ = value;
1153                 onChanged();
1154                 return this;
1155             }
1156 
1157             /**
1158              * <code>required double z = 1;</code>
1159              */
1160             public Builder clearZ() {
1161                 bitField0_ = (bitField0_ & ~0x00000001);
1162                 z_ = 0D;
1163                 onChanged();
1164                 return this;
1165             }
1166 
1167             // @@protoc_insertion_point(builder_scope:tutorial.Result)
1168         }
1169 
1170         static {
1171             defaultInstance = new Result(true);
1172             defaultInstance.initFields();
1173         }
1174 
1175         // @@protoc_insertion_point(class_scope:tutorial.Result)
1176     }
1177 
1178     private static com.google.protobuf.Descriptors.Descriptor internal_static_tutorial_Computation_descriptor;
1179 
1180     private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tutorial_Computation_fieldAccessorTable;
1181 
1182     private static com.google.protobuf.Descriptors.Descriptor internal_static_tutorial_Result_descriptor;
1183 
1184     private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tutorial_Result_fieldAccessorTable;
1185 
1186     public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
1187         return descriptor;
1188     }
1189 
1190     private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
1191     static {
1192         java.lang.String[] descriptorData = { "\n\034src/test/protobuf/calc.proto\022\010tutorial"
1193                 + "\"\215\001\n\013Computation\022\t\n\001x\030\001 \002(\001\022\t\n\001y\030\002 \002(\001\0220"
1194                 + "\n\010operator\030\003 \002(\0162\036.tutorial.Computation."
1195                 + "Operator\"6\n\010Operator\022\010\n\004PLUS\020\000\022\t\n\005MINUS\020"
1196                 + "\001\022\t\n\005TIMES\020\002\022\n\n\006DIVIDE\020\003\"\023\n\006Result\022\t\n\001z\030"
1197                 + "\001 \002(\001B(\n org.apache.mina.generated.proto" + "cB\004Calc" };
1198         com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
1199             public com.google.protobuf.ExtensionRegistry assignDescriptors(
1200                     com.google.protobuf.Descriptors.FileDescriptor root) {
1201                 descriptor = root;
1202                 internal_static_tutorial_Computation_descriptor = getDescriptor().getMessageTypes().get(0);
1203                 internal_static_tutorial_Computation_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
1204                         internal_static_tutorial_Computation_descriptor,
1205                         new java.lang.String[] { "X", "Y", "Operator", });
1206                 internal_static_tutorial_Result_descriptor = getDescriptor().getMessageTypes().get(1);
1207                 internal_static_tutorial_Result_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
1208                         internal_static_tutorial_Result_descriptor, new java.lang.String[] { "Z", });
1209                 return null;
1210             }
1211         };
1212         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData,
1213                 new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner);
1214     }
1215 
1216     // @@protoc_insertion_point(outer_class_scope)
1217 }