Class ServiceDescriptor (3.15.8)

public sealed class ServiceDescriptor : DescriptorBase, IDescriptor

Describes a service type.

Inheritance

Object > DescriptorBase > ServiceDescriptor

Implements

IDescriptor

Namespace

Google.Protobuf.Reflection

Assembly

Google.Protobuf.dll

Properties

CustomOptions

public CustomOptions CustomOptions { get; }

The (possibly empty) set of custom options for this service.

Property Value
TypeDescription
CustomOptions

Methods

public IList<MethodDescriptor> Methods { get; }
Property Value
TypeDescription
IList<MethodDescriptor>

An unmodifiable list of methods in this service.

Name

public override string Name { get; }

The brief name of the descriptor's target.

Property Value
TypeDescription
String
Overrides

Methods

FindMethodByName(String)

public MethodDescriptor FindMethodByName(String name)

Finds a method by name.

Parameter
NameDescription
nameString

The unqualified name of the method (e.g. "Foo").

Returns
TypeDescription
MethodDescriptor

The method's descriptor, or null if not found.

GetOption<T>(Extension<ServiceOptions, T>)

public T GetOption<T>(Extension<ServiceOptions, T> extension)

Gets a single value service option for this descriptor

Parameter
NameDescription
extensionExtension<ServiceOptions, T>
Returns
TypeDescription
T
Type Parameter
NameDescription
T

GetOption<T>(RepeatedExtension<ServiceOptions, T>)

public RepeatedField<T> GetOption<T>(RepeatedExtension<ServiceOptions, T> extension)

Gets a repeated value service option for this descriptor

Parameter
NameDescription
extensionRepeatedExtension<ServiceOptions, T>
Returns
TypeDescription
RepeatedField<T>
Type Parameter
NameDescription
T

GetOptions()

public ServiceOptions GetOptions()

The ServiceOptions, defined in descriptor.proto. If the options message is not present (i.e. there are no options), null is returned. Custom options can be retrieved as extensions of the returned message. NOTE: A defensive copy is created each time this property is retrieved.

Returns
TypeDescription
ServiceOptions