Advertisement
Guest User

Untitled

a guest
Aug 11th, 2014
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 16.74 KB | None | 0 0
  1.  
  2. // Generated by the protocol buffer compiler.  DO NOT EDIT!
  3. // source: test.proto
  4.  
  5. public final class Test {
  6.   private Test() {}
  7.   public static void registerAllExtensions(
  8.       com.google.protobuf.ExtensionRegistry registry) {
  9.   }
  10.   public interface BookOrBuilder
  11.       extends com.google.protobuf.MessageOrBuilder {
  12.  
  13.     // required string isbn = 1;
  14.     /**
  15.      * <code>required string isbn = 1;</code>
  16.      */
  17.     boolean hasIsbn();
  18.     /**
  19.      * <code>required string isbn = 1;</code>
  20.      */
  21.     java.lang.String getIsbn();
  22.     /**
  23.      * <code>required string isbn = 1;</code>
  24.      */
  25.     com.google.protobuf.ByteString
  26.         getIsbnBytes();
  27.   }
  28.   /**
  29.    * Protobuf type {@code Book}
  30.    */
  31.   public static final class Book extends
  32.       com.google.protobuf.GeneratedMessage
  33.       implements BookOrBuilder {
  34.     // Use Book.newBuilder() to construct.
  35.     private Book(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  36.       super(builder);
  37.       this.unknownFields = builder.getUnknownFields();
  38.     }
  39.     private Book(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  40.  
  41.     private static final Book defaultInstance;
  42.     public static Book getDefaultInstance() {
  43.       return defaultInstance;
  44.     }
  45.  
  46.     public Book getDefaultInstanceForType() {
  47.       return defaultInstance;
  48.     }
  49.  
  50.     private final com.google.protobuf.UnknownFieldSet unknownFields;
  51.     @java.lang.Override
  52.     public final com.google.protobuf.UnknownFieldSet
  53.         getUnknownFields() {
  54.       return this.unknownFields;
  55.     }
  56.     private Book(
  57.         com.google.protobuf.CodedInputStream input,
  58.         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  59.         throws com.google.protobuf.InvalidProtocolBufferException {
  60.       initFields();
  61.       int mutable_bitField0_ = 0;
  62.       com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  63.           com.google.protobuf.UnknownFieldSet.newBuilder();
  64.       try {
  65.         boolean done = false;
  66.         while (!done) {
  67.           int tag = input.readTag();
  68.           switch (tag) {
  69.             case 0:
  70.               done = true;
  71.               break;
  72.             default: {
  73.               if (!parseUnknownField(input, unknownFields,
  74.                                      extensionRegistry, tag)) {
  75.                 done = true;
  76.               }
  77.               break;
  78.             }
  79.             case 10: {
  80.               bitField0_ |= 0x00000001;
  81.               isbn_ = input.readBytes();
  82.               break;
  83.             }
  84.           }
  85.         }
  86.       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  87.         throw e.setUnfinishedMessage(this);
  88.       } catch (java.io.IOException e) {
  89.         throw new com.google.protobuf.InvalidProtocolBufferException(
  90.             e.getMessage()).setUnfinishedMessage(this);
  91.       } finally {
  92.         this.unknownFields = unknownFields.build();
  93.         makeExtensionsImmutable();
  94.       }
  95.     }
  96.     public static final com.google.protobuf.Descriptors.Descriptor
  97.         getDescriptor() {
  98.       return Test.internal_static_Book_descriptor;
  99.     }
  100.  
  101.     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  102.         internalGetFieldAccessorTable() {
  103.       return Test.internal_static_Book_fieldAccessorTable
  104.           .ensureFieldAccessorsInitialized(
  105.               Test.Book.class, Test.Book.Builder.class);
  106.     }
  107.  
  108.     public static com.google.protobuf.Parser<Book> PARSER =
  109.         new com.google.protobuf.AbstractParser<Book>() {
  110.       public Book parsePartialFrom(
  111.           com.google.protobuf.CodedInputStream input,
  112.           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  113.           throws com.google.protobuf.InvalidProtocolBufferException {
  114.         return new Book(input, extensionRegistry);
  115.       }
  116.     };
  117.  
  118.     @java.lang.Override
  119.     public com.google.protobuf.Parser<Book> getParserForType() {
  120.       return PARSER;
  121.     }
  122.  
  123.     private int bitField0_;
  124.     // required string isbn = 1;
  125.     public static final int ISBN_FIELD_NUMBER = 1;
  126.     private java.lang.Object isbn_;
  127.     /**
  128.      * <code>required string isbn = 1;</code>
  129.      */
  130.     public boolean hasIsbn() {
  131.       return ((bitField0_ & 0x00000001) == 0x00000001);
  132.     }
  133.     /**
  134.      * <code>required string isbn = 1;</code>
  135.      */
  136.     public java.lang.String getIsbn() {
  137.       java.lang.Object ref = isbn_;
  138.       if (ref instanceof java.lang.String) {
  139.         return (java.lang.String) ref;
  140.       } else {
  141.         com.google.protobuf.ByteString bs =
  142.             (com.google.protobuf.ByteString) ref;
  143.         java.lang.String s = bs.toStringUtf8();
  144.         if (bs.isValidUtf8()) {
  145.           isbn_ = s;
  146.         }
  147.         return s;
  148.       }
  149.     }
  150.     /**
  151.      * <code>required string isbn = 1;</code>
  152.      */
  153.     public com.google.protobuf.ByteString
  154.         getIsbnBytes() {
  155.       java.lang.Object ref = isbn_;
  156.       if (ref instanceof java.lang.String) {
  157.         com.google.protobuf.ByteString b =
  158.             com.google.protobuf.ByteString.copyFromUtf8(
  159.                 (java.lang.String) ref);
  160.         isbn_ = b;
  161.         return b;
  162.       } else {
  163.         return (com.google.protobuf.ByteString) ref;
  164.       }
  165.     }
  166.  
  167.     private void initFields() {
  168.       isbn_ = "";
  169.     }
  170.     private byte memoizedIsInitialized = -1;
  171.     public final boolean isInitialized() {
  172.       byte isInitialized = memoizedIsInitialized;
  173.       if (isInitialized != -1) return isInitialized == 1;
  174.  
  175.       if (!hasIsbn()) {
  176.         memoizedIsInitialized = 0;
  177.         return false;
  178.       }
  179.       memoizedIsInitialized = 1;
  180.       return true;
  181.     }
  182.  
  183.     public void writeTo(com.google.protobuf.CodedOutputStream output)
  184.                         throws java.io.IOException {
  185.       getSerializedSize();
  186.       if (((bitField0_ & 0x00000001) == 0x00000001)) {
  187.         output.writeBytes(1, getIsbnBytes());
  188.       }
  189.       getUnknownFields().writeTo(output);
  190.     }
  191.  
  192.     private int memoizedSerializedSize = -1;
  193.     public int getSerializedSize() {
  194.       int size = memoizedSerializedSize;
  195.       if (size != -1) return size;
  196.  
  197.       size = 0;
  198.       if (((bitField0_ & 0x00000001) == 0x00000001)) {
  199.         size += com.google.protobuf.CodedOutputStream
  200.           .computeBytesSize(1, getIsbnBytes());
  201.       }
  202.       size += getUnknownFields().getSerializedSize();
  203.       memoizedSerializedSize = size;
  204.       return size;
  205.     }
  206.  
  207.     private static final long serialVersionUID = 0L;
  208.     @java.lang.Override
  209.     protected java.lang.Object writeReplace()
  210.         throws java.io.ObjectStreamException {
  211.       return super.writeReplace();
  212.     }
  213.  
  214.     public static Test.Book parseFrom(
  215.         com.google.protobuf.ByteString data)
  216.         throws com.google.protobuf.InvalidProtocolBufferException {
  217.       return PARSER.parseFrom(data);
  218.     }
  219.     public static Test.Book parseFrom(
  220.         com.google.protobuf.ByteString data,
  221.         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  222.         throws com.google.protobuf.InvalidProtocolBufferException {
  223.       return PARSER.parseFrom(data, extensionRegistry);
  224.     }
  225.     public static Test.Book parseFrom(byte[] data)
  226.         throws com.google.protobuf.InvalidProtocolBufferException {
  227.       return PARSER.parseFrom(data);
  228.     }
  229.     public static Test.Book parseFrom(
  230.         byte[] data,
  231.         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  232.         throws com.google.protobuf.InvalidProtocolBufferException {
  233.       return PARSER.parseFrom(data, extensionRegistry);
  234.     }
  235.     public static Test.Book parseFrom(java.io.InputStream input)
  236.         throws java.io.IOException {
  237.       return PARSER.parseFrom(input);
  238.     }
  239.     public static Test.Book parseFrom(
  240.         java.io.InputStream input,
  241.         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  242.         throws java.io.IOException {
  243.       return PARSER.parseFrom(input, extensionRegistry);
  244.     }
  245.     public static Test.Book parseDelimitedFrom(java.io.InputStream input)
  246.         throws java.io.IOException {
  247.       return PARSER.parseDelimitedFrom(input);
  248.     }
  249.     public static Test.Book parseDelimitedFrom(
  250.         java.io.InputStream input,
  251.         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  252.         throws java.io.IOException {
  253.       return PARSER.parseDelimitedFrom(input, extensionRegistry);
  254.     }
  255.     public static Test.Book parseFrom(
  256.         com.google.protobuf.CodedInputStream input)
  257.         throws java.io.IOException {
  258.       return PARSER.parseFrom(input);
  259.     }
  260.     public static Test.Book parseFrom(
  261.         com.google.protobuf.CodedInputStream input,
  262.         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  263.         throws java.io.IOException {
  264.       return PARSER.parseFrom(input, extensionRegistry);
  265.     }
  266.  
  267.     public static Builder newBuilder() { return Builder.create(); }
  268.     public Builder newBuilderForType() { return newBuilder(); }
  269.     public static Builder newBuilder(Test.Book prototype) {
  270.       return newBuilder().mergeFrom(prototype);
  271.     }
  272.     public Builder toBuilder() { return newBuilder(this); }
  273.  
  274.     @java.lang.Override
  275.     protected Builder newBuilderForType(
  276.         com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  277.       Builder builder = new Builder(parent);
  278.       return builder;
  279.     }
  280.     /**
  281.      * Protobuf type {@code Book}
  282.      */
  283.     public static final class Builder extends
  284.         com.google.protobuf.GeneratedMessage.Builder<Builder>
  285.        implements Test.BookOrBuilder {
  286.       public static final com.google.protobuf.Descriptors.Descriptor
  287.           getDescriptor() {
  288.         return Test.internal_static_Book_descriptor;
  289.       }
  290.  
  291.       protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  292.           internalGetFieldAccessorTable() {
  293.         return Test.internal_static_Book_fieldAccessorTable
  294.             .ensureFieldAccessorsInitialized(
  295.                 Test.Book.class, Test.Book.Builder.class);
  296.       }
  297.  
  298.       // Construct using Test.Book.newBuilder()
  299.       private Builder() {
  300.         maybeForceBuilderInitialization();
  301.       }
  302.  
  303.       private Builder(
  304.           com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  305.         super(parent);
  306.         maybeForceBuilderInitialization();
  307.       }
  308.       private void maybeForceBuilderInitialization() {
  309.         if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  310.         }
  311.       }
  312.       private static Builder create() {
  313.         return new Builder();
  314.       }
  315.  
  316.       public Builder clear() {
  317.         super.clear();
  318.         isbn_ = "";
  319.         bitField0_ = (bitField0_ & ~0x00000001);
  320.         return this;
  321.       }
  322.  
  323.       public Builder clone() {
  324.         return create().mergeFrom(buildPartial());
  325.       }
  326.  
  327.       public com.google.protobuf.Descriptors.Descriptor
  328.           getDescriptorForType() {
  329.         return Test.internal_static_Book_descriptor;
  330.       }
  331.  
  332.       public Test.Book getDefaultInstanceForType() {
  333.         return Test.Book.getDefaultInstance();
  334.       }
  335.  
  336.       public Test.Book build() {
  337.         Test.Book result = buildPartial();
  338.         if (!result.isInitialized()) {
  339.           throw newUninitializedMessageException(result);
  340.         }
  341.         return result;
  342.       }
  343.  
  344.       public Test.Book buildPartial() {
  345.         Test.Book result = new Test.Book(this);
  346.         int from_bitField0_ = bitField0_;
  347.         int to_bitField0_ = 0;
  348.         if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  349.           to_bitField0_ |= 0x00000001;
  350.         }
  351.         result.isbn_ = isbn_;
  352.         result.bitField0_ = to_bitField0_;
  353.         onBuilt();
  354.         return result;
  355.       }
  356.  
  357.       public Builder mergeFrom(com.google.protobuf.Message other) {
  358.         if (other instanceof Test.Book) {
  359.           return mergeFrom((Test.Book)other);
  360.         } else {
  361.           super.mergeFrom(other);
  362.           return this;
  363.         }
  364.       }
  365.  
  366.       public Builder mergeFrom(Test.Book other) {
  367.         if (other == Test.Book.getDefaultInstance()) return this;
  368.         if (other.hasIsbn()) {
  369.           bitField0_ |= 0x00000001;
  370.           isbn_ = other.isbn_;
  371.           onChanged();
  372.         }
  373.         this.mergeUnknownFields(other.getUnknownFields());
  374.         return this;
  375.       }
  376.  
  377.       public final boolean isInitialized() {
  378.         if (!hasIsbn()) {
  379.          
  380.           return false;
  381.         }
  382.         return true;
  383.       }
  384.  
  385.       public Builder mergeFrom(
  386.           com.google.protobuf.CodedInputStream input,
  387.           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  388.           throws java.io.IOException {
  389.         Test.Book parsedMessage = null;
  390.         try {
  391.           parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  392.         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  393.           parsedMessage = (Test.Book) e.getUnfinishedMessage();
  394.           throw e;
  395.         } finally {
  396.           if (parsedMessage != null) {
  397.             mergeFrom(parsedMessage);
  398.           }
  399.         }
  400.         return this;
  401.       }
  402.       private int bitField0_;
  403.  
  404.       // required string isbn = 1;
  405.       private java.lang.Object isbn_ = "";
  406.       /**
  407.        * <code>required string isbn = 1;</code>
  408.        */
  409.       public boolean hasIsbn() {
  410.         return ((bitField0_ & 0x00000001) == 0x00000001);
  411.       }
  412.       /**
  413.        * <code>required string isbn = 1;</code>
  414.        */
  415.       public java.lang.String getIsbn() {
  416.         java.lang.Object ref = isbn_;
  417.         if (!(ref instanceof java.lang.String)) {
  418.           java.lang.String s = ((com.google.protobuf.ByteString) ref)
  419.               .toStringUtf8();
  420.           isbn_ = s;
  421.           return s;
  422.         } else {
  423.           return (java.lang.String) ref;
  424.         }
  425.       }
  426.       /**
  427.        * <code>required string isbn = 1;</code>
  428.        */
  429.       public com.google.protobuf.ByteString
  430.           getIsbnBytes() {
  431.         java.lang.Object ref = isbn_;
  432.         if (ref instanceof String) {
  433.           com.google.protobuf.ByteString b =
  434.               com.google.protobuf.ByteString.copyFromUtf8(
  435.                   (java.lang.String) ref);
  436.           isbn_ = b;
  437.           return b;
  438.         } else {
  439.           return (com.google.protobuf.ByteString) ref;
  440.         }
  441.       }
  442.       /**
  443.        * <code>required string isbn = 1;</code>
  444.        */
  445.       public Builder setIsbn(
  446.           java.lang.String value) {
  447.         if (value == null) {
  448.     throw new NullPointerException();
  449.   }
  450.   bitField0_ |= 0x00000001;
  451.         isbn_ = value;
  452.         onChanged();
  453.         return this;
  454.       }
  455.       /**
  456.        * <code>required string isbn = 1;</code>
  457.        */
  458.       public Builder clearIsbn() {
  459.         bitField0_ = (bitField0_ & ~0x00000001);
  460.         isbn_ = getDefaultInstance().getIsbn();
  461.         onChanged();
  462.         return this;
  463.       }
  464.       /**
  465.        * <code>required string isbn = 1;</code>
  466.        */
  467.       public Builder setIsbnBytes(
  468.           com.google.protobuf.ByteString value) {
  469.         if (value == null) {
  470.     throw new NullPointerException();
  471.   }
  472.   bitField0_ |= 0x00000001;
  473.         isbn_ = value;
  474.         onChanged();
  475.         return this;
  476.       }
  477.  
  478.       // @@protoc_insertion_point(builder_scope:Book)
  479.     }
  480.  
  481.     static {
  482.       defaultInstance = new Book(true);
  483.       defaultInstance.initFields();
  484.     }
  485.  
  486.     // @@protoc_insertion_point(class_scope:Book)
  487.   }
  488.  
  489.   private static com.google.protobuf.Descriptors.Descriptor
  490.     internal_static_Book_descriptor;
  491.   private static
  492.     com.google.protobuf.GeneratedMessage.FieldAccessorTable
  493.       internal_static_Book_fieldAccessorTable;
  494.  
  495.   public static com.google.protobuf.Descriptors.FileDescriptor
  496.       getDescriptor() {
  497.     return descriptor;
  498.   }
  499.   private static com.google.protobuf.Descriptors.FileDescriptor
  500.       descriptor;
  501.   static {
  502.     java.lang.String[] descriptorData = {
  503.       "\n\ntest.proto\"\024\n\004Book\022\014\n\004isbn\030\001 \002(\t"
  504.     };
  505.     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
  506.       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  507.         public com.google.protobuf.ExtensionRegistry assignDescriptors(
  508.             com.google.protobuf.Descriptors.FileDescriptor root) {
  509.           descriptor = root;
  510.           internal_static_Book_descriptor =
  511.             getDescriptor().getMessageTypes().get(0);
  512.           internal_static_Book_fieldAccessorTable = new
  513.             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  514.               internal_static_Book_descriptor,
  515.               new java.lang.String[] { "Isbn", });
  516.           return null;
  517.         }
  518.       };
  519.     com.google.protobuf.Descriptors.FileDescriptor
  520.       .internalBuildGeneratedFileFrom(descriptorData,
  521.         new com.google.protobuf.Descriptors.FileDescriptor[] {
  522.         }, assigner);
  523.   }
  524.  
  525.   // @@protoc_insertion_point(outer_class_scope)
  526. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement