/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(builderForValue.build()); } return this; } /**
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.DescriptorProtos.MethodDescriptorProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.protobuf.DescriptorProtos.MethodDescriptorProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
/** * <code>optional .google.protobuf.MethodOptions options = 4;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder> getOptionsFieldBuilder() { if (optionsBuilder_ == null) { optionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder>( getOptions(), getParentForChildren(), isClean()); options_ = null; } return optionsBuilder_; }
return new Builder();
private MethodDescriptorProto generateMethod(Method method) { MethodDescriptorProto.Builder builder = MethodDescriptorProto.newBuilder(); builder.setName(method.getName()); builder.setInputType(getTypeName(method.getRequestTypeUrl())); builder.setOutputType(getTypeName(method.getResponseTypeUrl())); builder.setOptions(generateMethodOptions(method)); builder.setClientStreaming(method.getRequestStreaming()); // protoc set serverStreaming field as false for legacy streaming options, // but google.protobuf.Method set the responseStreaming field to true for both new and legacy // streaming setup. So we need to distinguish streaming style while generating // MethodDescriptorProto. // But we cannot distinguish if the new and old styles are both set which should be rare case. if (method.getResponseStreaming() && isLegacyStreaming(method)) { builder.setServerStreaming(false); } else { builder.setServerStreaming(method.getResponseStreaming()); } return builder.build(); }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.DescriptorProtos.MethodDescriptorProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.protobuf.DescriptorProtos.MethodDescriptorProto) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.DescriptorProtos.MethodDescriptorProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.protobuf.DescriptorProtos.MethodDescriptorProto) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
/** * <code>optional .google.protobuf.MethodOptions options = 4;</code> */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder> getOptionsFieldBuilder() { if (optionsBuilder_ == null) { optionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder>( options_, getParentForChildren(), isClean()); options_ = null; } return optionsBuilder_; }
/** * <code>optional .google.protobuf.MethodOptions options = 4;</code> */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder> getOptionsFieldBuilder() { if (optionsBuilder_ == null) { optionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder>( options_, getParentForChildren(), isClean()); options_ = null; } return optionsBuilder_; }
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder setMethod( int index, com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.set(index, builderForValue.build()); onChanged(); } else { methodBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( int index, com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(index, builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>optional .google.protobuf.MethodOptions options = 4;</code> */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder> getOptionsFieldBuilder() { if (optionsBuilder_ == null) { optionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder>( getOptions(), getParentForChildren(), isClean()); options_ = null; } return optionsBuilder_; }
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder setMethod( int index, com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.set(index, builderForValue.build()); onChanged(); } else { methodBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( int index, com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(index, builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder setMethod( int index, com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.set(index, builderForValue.build()); onChanged(); } else { methodBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>optional .google.protobuf.MethodOptions options = 4;</code> */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder> getOptionsFieldBuilder() { if (optionsBuilder_ == null) { optionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.DescriptorProtos.MethodOptions, com.google.protobuf.DescriptorProtos.MethodOptions.Builder, com.google.protobuf.DescriptorProtos.MethodOptionsOrBuilder>( getOptions(), getParentForChildren(), isClean()); options_ = null; } return optionsBuilder_; }
/** * <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code> */ public Builder addMethod( com.google.protobuf.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { if (methodBuilder_ == null) { ensureMethodIsMutable(); method_.add(builderForValue.build()); onChanged(); } else { methodBuilder_.addMessage(builderForValue.build()); } return this; } /**