Class DescriptorProtos.ServiceDescriptorProto.Builder (3.19.4)

public static final class DescriptorProtos.ServiceDescriptorProto.Builder extends GeneratedMessageV3.Builder<DescriptorProtos.ServiceDescriptorProto.Builder> implements DescriptorProtos.ServiceDescriptorProtoOrBuilder

Describes a service.

Protobuf type google.protobuf.ServiceDescriptorProto

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptors.Descriptor

Methods

addAllMethod(Iterable<? extends DescriptorProtos.MethodDescriptorProto> values)

public DescriptorProtos.ServiceDescriptorProto.Builder addAllMethod(Iterable<? extends DescriptorProtos.MethodDescriptorProto> values)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
values Iterable<? extends com.google.protobuf.DescriptorProtos.MethodDescriptorProto>
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

addMethod(DescriptorProtos.MethodDescriptorProto value)

public DescriptorProtos.ServiceDescriptorProto.Builder addMethod(DescriptorProtos.MethodDescriptorProto value)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
value DescriptorProtos.MethodDescriptorProto
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

addMethod(DescriptorProtos.MethodDescriptorProto.Builder builderForValue)

public DescriptorProtos.ServiceDescriptorProto.Builder addMethod(DescriptorProtos.MethodDescriptorProto.Builder builderForValue)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
builderForValue DescriptorProtos.MethodDescriptorProto.Builder
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

addMethod(int index, DescriptorProtos.MethodDescriptorProto value)

public DescriptorProtos.ServiceDescriptorProto.Builder addMethod(int index, DescriptorProtos.MethodDescriptorProto value)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameters
Name Description
index int
value DescriptorProtos.MethodDescriptorProto
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

addMethod(int index, DescriptorProtos.MethodDescriptorProto.Builder builderForValue)

public DescriptorProtos.ServiceDescriptorProto.Builder addMethod(int index, DescriptorProtos.MethodDescriptorProto.Builder builderForValue)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameters
Name Description
index int
builderForValue DescriptorProtos.MethodDescriptorProto.Builder
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

addMethodBuilder()

public DescriptorProtos.MethodDescriptorProto.Builder addMethodBuilder()

repeated .google.protobuf.MethodDescriptorProto method = 2;

Returns
Type Description
DescriptorProtos.MethodDescriptorProto.Builder

addMethodBuilder(int index)

public DescriptorProtos.MethodDescriptorProto.Builder addMethodBuilder(int index)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.MethodDescriptorProto.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.ServiceDescriptorProto.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field Descriptors.FieldDescriptor
value Object
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

build()

public DescriptorProtos.ServiceDescriptorProto build()
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto

buildPartial()

public DescriptorProtos.ServiceDescriptorProto buildPartial()
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto

clear()

public DescriptorProtos.ServiceDescriptorProto.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
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public DescriptorProtos.ServiceDescriptorProto.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field Descriptors.FieldDescriptor
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

clearMethod()

public DescriptorProtos.ServiceDescriptorProto.Builder clearMethod()

repeated .google.protobuf.MethodDescriptorProto method = 2;

Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

clearName()

public DescriptorProtos.ServiceDescriptorProto.Builder clearName()

optional string name = 1;

Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

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

Parameter
Name Description
oneof Descriptors.OneofDescriptor
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

clearOptions()

public DescriptorProtos.ServiceDescriptorProto.Builder clearOptions()

optional .google.protobuf.ServiceOptions options = 3;

Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

clone()

public DescriptorProtos.ServiceDescriptorProto.Builder clone()

Clones the Builder.

Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

getDefaultInstanceForType()

public DescriptorProtos.ServiceDescriptorProto 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
Type Description
DescriptorProtos.ServiceDescriptorProto

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
Type Description
Descriptors.Descriptor
Overrides

getMethod(int index)

public DescriptorProtos.MethodDescriptorProto getMethod(int index)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.MethodDescriptorProto

getMethodBuilder(int index)

public DescriptorProtos.MethodDescriptorProto.Builder getMethodBuilder(int index)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.MethodDescriptorProto.Builder

getMethodBuilderList()

public List<DescriptorProtos.MethodDescriptorProto.Builder> getMethodBuilderList()

repeated .google.protobuf.MethodDescriptorProto method = 2;

Returns
Type Description
List<Builder>

getMethodCount()

public int getMethodCount()

repeated .google.protobuf.MethodDescriptorProto method = 2;

Returns
Type Description
int

getMethodList()

public List<DescriptorProtos.MethodDescriptorProto> getMethodList()

repeated .google.protobuf.MethodDescriptorProto method = 2;

Returns
Type Description
List<MethodDescriptorProto>

getMethodOrBuilder(int index)

public DescriptorProtos.MethodDescriptorProtoOrBuilder getMethodOrBuilder(int index)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.MethodDescriptorProtoOrBuilder

getMethodOrBuilderList()

public List<? extends DescriptorProtos.MethodDescriptorProtoOrBuilder> getMethodOrBuilderList()

repeated .google.protobuf.MethodDescriptorProto method = 2;

Returns
Type Description
List<? extends com.google.protobuf.DescriptorProtos.MethodDescriptorProtoOrBuilder>

getName()

public String getName()

optional string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

optional string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getOptions()

public DescriptorProtos.ServiceOptions getOptions()

optional .google.protobuf.ServiceOptions options = 3;

Returns
Type Description
DescriptorProtos.ServiceOptions

The options.

getOptionsBuilder()

public DescriptorProtos.ServiceOptions.Builder getOptionsBuilder()

optional .google.protobuf.ServiceOptions options = 3;

Returns
Type Description
DescriptorProtos.ServiceOptions.Builder

getOptionsOrBuilder()

public DescriptorProtos.ServiceOptionsOrBuilder getOptionsOrBuilder()

optional .google.protobuf.ServiceOptions options = 3;

Returns
Type Description
DescriptorProtos.ServiceOptionsOrBuilder

hasName()

public boolean hasName()

optional string name = 1;

Returns
Type Description
boolean

Whether the name field is set.

hasOptions()

public boolean hasOptions()

optional .google.protobuf.ServiceOptions options = 3;

Returns
Type Description
boolean

Whether the options 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
Type Description
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
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DescriptorProtos.ServiceDescriptorProto.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
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(DescriptorProtos.ServiceDescriptorProto other)

public DescriptorProtos.ServiceDescriptorProto.Builder mergeFrom(DescriptorProtos.ServiceDescriptorProto other)
Parameter
Name Description
other DescriptorProtos.ServiceDescriptorProto
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

mergeFrom(Message other)

public DescriptorProtos.ServiceDescriptorProto.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
Name Description
other Message
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

mergeOptions(DescriptorProtos.ServiceOptions value)

public DescriptorProtos.ServiceDescriptorProto.Builder mergeOptions(DescriptorProtos.ServiceOptions value)

optional .google.protobuf.ServiceOptions options = 3;

Parameter
Name Description
value DescriptorProtos.ServiceOptions
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

removeMethod(int index)

public DescriptorProtos.ServiceDescriptorProto.Builder removeMethod(int index)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameter
Name Description
index int
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.ServiceDescriptorProto.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field Descriptors.FieldDescriptor
value Object
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

setMethod(int index, DescriptorProtos.MethodDescriptorProto value)

public DescriptorProtos.ServiceDescriptorProto.Builder setMethod(int index, DescriptorProtos.MethodDescriptorProto value)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameters
Name Description
index int
value DescriptorProtos.MethodDescriptorProto
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

setMethod(int index, DescriptorProtos.MethodDescriptorProto.Builder builderForValue)

public DescriptorProtos.ServiceDescriptorProto.Builder setMethod(int index, DescriptorProtos.MethodDescriptorProto.Builder builderForValue)

repeated .google.protobuf.MethodDescriptorProto method = 2;

Parameters
Name Description
index int
builderForValue DescriptorProtos.MethodDescriptorProto.Builder
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

setName(String value)

public DescriptorProtos.ServiceDescriptorProto.Builder setName(String value)

optional string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

This builder for chaining.

setNameBytes(ByteString value)

public DescriptorProtos.ServiceDescriptorProto.Builder setNameBytes(ByteString value)

optional string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

This builder for chaining.

setOptions(DescriptorProtos.ServiceOptions value)

public DescriptorProtos.ServiceDescriptorProto.Builder setOptions(DescriptorProtos.ServiceOptions value)

optional .google.protobuf.ServiceOptions options = 3;

Parameter
Name Description
value DescriptorProtos.ServiceOptions
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

setOptions(DescriptorProtos.ServiceOptions.Builder builderForValue)

public DescriptorProtos.ServiceDescriptorProto.Builder setOptions(DescriptorProtos.ServiceOptions.Builder builderForValue)

optional .google.protobuf.ServiceOptions options = 3;

Parameter
Name Description
builderForValue DescriptorProtos.ServiceOptions.Builder
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder

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

public DescriptorProtos.ServiceDescriptorProto.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field Descriptors.FieldDescriptor
index int
value Object
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.ServiceDescriptorProto.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DescriptorProtos.ServiceDescriptorProto.Builder
Overrides