Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- // source: test.proto
- public final class Test {
- private Test() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- }
- public interface BookOrBuilder
- extends com.google.protobuf.MessageOrBuilder {
- // required string isbn = 1;
- /**
- * <code>required string isbn = 1;</code>
- */
- boolean hasIsbn();
- /**
- * <code>required string isbn = 1;</code>
- */
- java.lang.String getIsbn();
- /**
- * <code>required string isbn = 1;</code>
- */
- com.google.protobuf.ByteString
- getIsbnBytes();
- }
- /**
- * Protobuf type {@code Book}
- */
- public static final class Book extends
- com.google.protobuf.GeneratedMessage
- implements BookOrBuilder {
- // Use Book.newBuilder() to construct.
- private Book(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
- super(builder);
- this.unknownFields = builder.getUnknownFields();
- }
- private Book(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
- private static final Book defaultInstance;
- public static Book getDefaultInstance() {
- return defaultInstance;
- }
- public Book getDefaultInstanceForType() {
- return defaultInstance;
- }
- private final com.google.protobuf.UnknownFieldSet unknownFields;
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private Book(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- initFields();
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- case 10: {
- bitField0_ |= 0x00000001;
- isbn_ = input.readBytes();
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e.getMessage()).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return Test.internal_static_Book_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return Test.internal_static_Book_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- Test.Book.class, Test.Book.Builder.class);
- }
- public static com.google.protobuf.Parser<Book> PARSER =
- new com.google.protobuf.AbstractParser<Book>() {
- public Book parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new Book(input, extensionRegistry);
- }
- };
- @java.lang.Override
- public com.google.protobuf.Parser<Book> getParserForType() {
- return PARSER;
- }
- private int bitField0_;
- // required string isbn = 1;
- public static final int ISBN_FIELD_NUMBER = 1;
- private java.lang.Object isbn_;
- /**
- * <code>required string isbn = 1;</code>
- */
- public boolean hasIsbn() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public java.lang.String getIsbn() {
- java.lang.Object ref = isbn_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- if (bs.isValidUtf8()) {
- isbn_ = s;
- }
- return s;
- }
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public com.google.protobuf.ByteString
- getIsbnBytes() {
- java.lang.Object ref = isbn_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- isbn_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- private void initFields() {
- isbn_ = "";
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
- if (!hasIsbn()) {
- memoizedIsInitialized = 0;
- return false;
- }
- memoizedIsInitialized = 1;
- return true;
- }
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getSerializedSize();
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, getIsbnBytes());
- }
- getUnknownFields().writeTo(output);
- }
- private int memoizedSerializedSize = -1;
- public int getSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- size = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getIsbnBytes());
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSerializedSize = size;
- return size;
- }
- private static final long serialVersionUID = 0L;
- @java.lang.Override
- protected java.lang.Object writeReplace()
- throws java.io.ObjectStreamException {
- return super.writeReplace();
- }
- public static Test.Book parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static Test.Book parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static Test.Book parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static Test.Book parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static Test.Book parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static Test.Book parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseFrom(input, extensionRegistry);
- }
- public static Test.Book parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input);
- }
- public static Test.Book parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input, extensionRegistry);
- }
- public static Test.Book parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static Test.Book parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseFrom(input, extensionRegistry);
- }
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(Test.Book prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code Book}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements Test.BookOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return Test.internal_static_Book_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return Test.internal_static_Book_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- Test.Book.class, Test.Book.Builder.class);
- }
- // Construct using Test.Book.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
- private Builder(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- }
- }
- private static Builder create() {
- return new Builder();
- }
- public Builder clear() {
- super.clear();
- isbn_ = "";
- bitField0_ = (bitField0_ & ~0x00000001);
- return this;
- }
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return Test.internal_static_Book_descriptor;
- }
- public Test.Book getDefaultInstanceForType() {
- return Test.Book.getDefaultInstance();
- }
- public Test.Book build() {
- Test.Book result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
- public Test.Book buildPartial() {
- Test.Book result = new Test.Book(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- result.isbn_ = isbn_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof Test.Book) {
- return mergeFrom((Test.Book)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
- public Builder mergeFrom(Test.Book other) {
- if (other == Test.Book.getDefaultInstance()) return this;
- if (other.hasIsbn()) {
- bitField0_ |= 0x00000001;
- isbn_ = other.isbn_;
- onChanged();
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
- public final boolean isInitialized() {
- if (!hasIsbn()) {
- return false;
- }
- return true;
- }
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- Test.Book parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (Test.Book) e.getUnfinishedMessage();
- throw e;
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
- // required string isbn = 1;
- private java.lang.Object isbn_ = "";
- /**
- * <code>required string isbn = 1;</code>
- */
- public boolean hasIsbn() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public java.lang.String getIsbn() {
- java.lang.Object ref = isbn_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- isbn_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public com.google.protobuf.ByteString
- getIsbnBytes() {
- java.lang.Object ref = isbn_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- isbn_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public Builder setIsbn(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- isbn_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public Builder clearIsbn() {
- bitField0_ = (bitField0_ & ~0x00000001);
- isbn_ = getDefaultInstance().getIsbn();
- onChanged();
- return this;
- }
- /**
- * <code>required string isbn = 1;</code>
- */
- public Builder setIsbnBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- isbn_ = value;
- onChanged();
- return this;
- }
- // @@protoc_insertion_point(builder_scope:Book)
- }
- static {
- defaultInstance = new Book(true);
- defaultInstance.initFields();
- }
- // @@protoc_insertion_point(class_scope:Book)
- }
- private static com.google.protobuf.Descriptors.Descriptor
- internal_static_Book_descriptor;
- private static
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_Book_fieldAccessorTable;
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\ntest.proto\"\024\n\004Book\022\014\n\004isbn\030\001 \002(\t"
- };
- com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
- new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
- public com.google.protobuf.ExtensionRegistry assignDescriptors(
- com.google.protobuf.Descriptors.FileDescriptor root) {
- descriptor = root;
- internal_static_Book_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_Book_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_Book_descriptor,
- new java.lang.String[] { "Isbn", });
- return null;
- }
- };
- com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- }, assigner);
- }
- // @@protoc_insertion_point(outer_class_scope)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement