Class DescriptorProtos.MethodDescriptorProto.Builder (3.19.4)

public static final class DescriptorProtos.MethodDescriptorProto.Builder extends GeneratedMessageV3.Builder<DescriptorProtos.MethodDescriptorProto.Builder> implements DescriptorProtos.MethodDescriptorProtoOrBuilder

Describes a method of a service.

Protobuf type google.protobuf.MethodDescriptorProto

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptors.Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.MethodDescriptorProto.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

build()

public DescriptorProtos.MethodDescriptorProto build()
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto

buildPartial()

public DescriptorProtos.MethodDescriptorProto buildPartial()
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto

clear()

public DescriptorProtos.MethodDescriptorProto.Builder clear()

Called by the initialization and clear code paths to allow subclasses to reset any of their builtin fields back to the initial values.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

clearClientStreaming()

public DescriptorProtos.MethodDescriptorProto.Builder clearClientStreaming()

Identifies if client streams multiple client messages

optional bool client_streaming = 5 [default = false];

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public DescriptorProtos.MethodDescriptorProto.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldDescriptors.FieldDescriptor
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

clearInputType()

public DescriptorProtos.MethodDescriptorProto.Builder clearInputType()

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

optional string input_type = 2;

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

clearName()

public DescriptorProtos.MethodDescriptorProto.Builder clearName()

optional string name = 1;

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public DescriptorProtos.MethodDescriptorProto.Builder clearOneof(Descriptors.OneofDescriptor oneof)

TODO(jieluo): Clear it when all subclasses have implemented this method.

Parameter
NameDescription
oneofDescriptors.OneofDescriptor
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

clearOptions()

public DescriptorProtos.MethodDescriptorProto.Builder clearOptions()

optional .google.protobuf.MethodOptions options = 4;

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

clearOutputType()

public DescriptorProtos.MethodDescriptorProto.Builder clearOutputType()

optional string output_type = 3;

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

clearServerStreaming()

public DescriptorProtos.MethodDescriptorProto.Builder clearServerStreaming()

Identifies if server streams multiple server messages

optional bool server_streaming = 6 [default = false];

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

clone()

public DescriptorProtos.MethodDescriptorProto.Builder clone()

Clones the Builder.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

getClientStreaming()

public boolean getClientStreaming()

Identifies if client streams multiple client messages

optional bool client_streaming = 5 [default = false];

Returns
TypeDescription
boolean

The clientStreaming.

getDefaultInstanceForType()

public DescriptorProtos.MethodDescriptorProto getDefaultInstanceForType()

Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the getDefaultInstance() method of generated message classes in that this method is an abstract method of the MessageLite interface whereas getDefaultInstance() is a static method of a specific class. They return the same thing.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()

Get the message's type's descriptor. This differs from the getDescriptor() method of generated message classes in that this method is an abstract method of the Message interface whereas getDescriptor() is a static method of a specific class. They return the same thing.

Returns
TypeDescription
Descriptors.Descriptor
Overrides

getInputType()

public String getInputType()

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

optional string input_type = 2;

Returns
TypeDescription
String

The inputType.

getInputTypeBytes()

public ByteString getInputTypeBytes()

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

optional string input_type = 2;

Returns
TypeDescription
ByteString

The bytes for inputType.

getName()

public String getName()

optional string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

optional string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getOptions()

public DescriptorProtos.MethodOptions getOptions()

optional .google.protobuf.MethodOptions options = 4;

Returns
TypeDescription
DescriptorProtos.MethodOptions

The options.

getOptionsBuilder()

public DescriptorProtos.MethodOptions.Builder getOptionsBuilder()

optional .google.protobuf.MethodOptions options = 4;

Returns
TypeDescription
DescriptorProtos.MethodOptions.Builder

getOptionsOrBuilder()

public DescriptorProtos.MethodOptionsOrBuilder getOptionsOrBuilder()

optional .google.protobuf.MethodOptions options = 4;

Returns
TypeDescription
DescriptorProtos.MethodOptionsOrBuilder

getOutputType()

public String getOutputType()

optional string output_type = 3;

Returns
TypeDescription
String

The outputType.

getOutputTypeBytes()

public ByteString getOutputTypeBytes()

optional string output_type = 3;

Returns
TypeDescription
ByteString

The bytes for outputType.

getServerStreaming()

public boolean getServerStreaming()

Identifies if server streams multiple server messages

optional bool server_streaming = 6 [default = false];

Returns
TypeDescription
boolean

The serverStreaming.

hasClientStreaming()

public boolean hasClientStreaming()

Identifies if client streams multiple client messages

optional bool client_streaming = 5 [default = false];

Returns
TypeDescription
boolean

Whether the clientStreaming field is set.

hasInputType()

public boolean hasInputType()

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

optional string input_type = 2;

Returns
TypeDescription
boolean

Whether the inputType field is set.

hasName()

public boolean hasName()

optional string name = 1;

Returns
TypeDescription
boolean

Whether the name field is set.

hasOptions()

public boolean hasOptions()

optional .google.protobuf.MethodOptions options = 4;

Returns
TypeDescription
boolean

Whether the options field is set.

hasOutputType()

public boolean hasOutputType()

optional string output_type = 3;

Returns
TypeDescription
boolean

Whether the outputType field is set.

hasServerStreaming()

public boolean hasServerStreaming()

Identifies if server streams multiple server messages

optional bool server_streaming = 6 [default = false];

Returns
TypeDescription
boolean

Whether the serverStreaming field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()

Get the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.

Returns
TypeDescription
GeneratedMessageV3.FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()

Returns true if all required fields in the message and all embedded messages are set, false otherwise.

See also: MessageOrBuilder#getInitializationErrorString()

Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DescriptorProtos.MethodDescriptorProto.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

Like Builder#mergeFrom(CodedInputStream), but also parses extensions. The extensions that you want to be able to parse must be registered in extensionRegistry. Extensions not in the registry will be treated as unknown fields.

Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(DescriptorProtos.MethodDescriptorProto other)

public DescriptorProtos.MethodDescriptorProto.Builder mergeFrom(DescriptorProtos.MethodDescriptorProto other)
Parameter
NameDescription
otherDescriptorProtos.MethodDescriptorProto
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

mergeFrom(Message other)

public DescriptorProtos.MethodDescriptorProto.Builder mergeFrom(Message other)

Merge other into the message being built. other must have the exact same type as this (i.e. getDescriptorForType() == other.getDescriptorForType()).

Merging occurs as follows. For each field:

  • For singular primitive fields, if the field is set in other, then other's value overwrites the value in this message.
  • For singular message fields, if the field is set in other, it is merged into the corresponding sub-message of this message using the same merging rules.
  • For repeated fields, the elements in other are concatenated with the elements in this message.
  • For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.

    This is equivalent to the Message::MergeFrom method in C++.

Parameter
NameDescription
otherMessage
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

mergeOptions(DescriptorProtos.MethodOptions value)

public DescriptorProtos.MethodDescriptorProto.Builder mergeOptions(DescriptorProtos.MethodOptions value)

optional .google.protobuf.MethodOptions options = 4;

Parameter
NameDescription
valueDescriptorProtos.MethodOptions
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.MethodDescriptorProto.Builder mergeUnknownFields(UnknownFieldSet unknownFields)

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

setClientStreaming(boolean value)

public DescriptorProtos.MethodDescriptorProto.Builder setClientStreaming(boolean value)

Identifies if client streams multiple client messages

optional bool client_streaming = 5 [default = false];

Parameter
NameDescription
valueboolean

The clientStreaming to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.MethodDescriptorProto.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

setInputType(String value)

public DescriptorProtos.MethodDescriptorProto.Builder setInputType(String value)

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

optional string input_type = 2;

Parameter
NameDescription
valueString

The inputType to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setInputTypeBytes(ByteString value)

public DescriptorProtos.MethodDescriptorProto.Builder setInputTypeBytes(ByteString value)

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

optional string input_type = 2;

Parameter
NameDescription
valueByteString

The bytes for inputType to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setName(String value)

public DescriptorProtos.MethodDescriptorProto.Builder setName(String value)

optional string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setNameBytes(ByteString value)

public DescriptorProtos.MethodDescriptorProto.Builder setNameBytes(ByteString value)

optional string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setOptions(DescriptorProtos.MethodOptions value)

public DescriptorProtos.MethodDescriptorProto.Builder setOptions(DescriptorProtos.MethodOptions value)

optional .google.protobuf.MethodOptions options = 4;

Parameter
NameDescription
valueDescriptorProtos.MethodOptions
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

setOptions(DescriptorProtos.MethodOptions.Builder builderForValue)

public DescriptorProtos.MethodDescriptorProto.Builder setOptions(DescriptorProtos.MethodOptions.Builder builderForValue)

optional .google.protobuf.MethodOptions options = 4;

Parameter
NameDescription
builderForValueDescriptorProtos.MethodOptions.Builder
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

setOutputType(String value)

public DescriptorProtos.MethodDescriptorProto.Builder setOutputType(String value)

optional string output_type = 3;

Parameter
NameDescription
valueString

The outputType to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setOutputTypeBytes(ByteString value)

public DescriptorProtos.MethodDescriptorProto.Builder setOutputTypeBytes(ByteString value)

optional string output_type = 3;

Parameter
NameDescription
valueByteString

The bytes for outputType to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public DescriptorProtos.MethodDescriptorProto.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
indexint
valueObject
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides

setServerStreaming(boolean value)

public DescriptorProtos.MethodDescriptorProto.Builder setServerStreaming(boolean value)

Identifies if server streams multiple server messages

optional bool server_streaming = 6 [default = false];

Parameter
NameDescription
valueboolean

The serverStreaming to set.

Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.MethodDescriptorProto.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.MethodDescriptorProto.Builder
Overrides