Class Descriptors.ServiceDescriptor
java.lang.Object
com.google.protobuf.Descriptors.GenericDescriptor
com.google.protobuf.Descriptors.ServiceDescriptor
- Enclosing class:
Descriptors
Describes a service type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Descriptors.FileDescriptorprivate final Stringprivate final intprivate Descriptors.MethodDescriptor[]private DescriptorProtos.ServiceOptionsFields inherited from class Descriptors.GenericDescriptor
features -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateServiceDescriptor(DescriptorProtos.ServiceDescriptorProto proto, Descriptors.FileDescriptor file, int index) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidfindMethodByName(String name) Find a method by name.getFile()Get theDescriptors.FileDescriptorcontaining this descriptor.Get the type's fully-qualified name.intgetIndex()Get the index of this descriptor within its parent.getMethod(int index) Get the service's method at the specified index.intGet a count of methods for this service.Get a list of methods for this service.getName()Get the type's unqualified name.Get theServiceOptions, defined indescriptor.proto.(package private) Descriptors.GenericDescriptorprivate voidSee.invalid reference
FileDescriptor#resolveAllFeaturesprivate voidtoProto()Convert the descriptor to its protocol message representation.Methods inherited from class Descriptors.GenericDescriptor
getFeatures, inferLegacyProtoFeatures, resolveFeatures, validateFeatures
-
Field Details
-
index
private final int index -
proto
-
options
-
fullName
-
file
-
methods
-
-
Constructor Details
-
ServiceDescriptor
private ServiceDescriptor(DescriptorProtos.ServiceDescriptorProto proto, Descriptors.FileDescriptor file, int index) throws Descriptors.DescriptorValidationException
-
-
Method Details
-
getIndex
public int getIndex()Get the index of this descriptor within its parent. * @see Descriptors.Descriptor#getIndex() -
toProto
Convert the descriptor to its protocol message representation.- Specified by:
toProtoin classDescriptors.GenericDescriptor
-
getName
Get the type's unqualified name.- Specified by:
getNamein classDescriptors.GenericDescriptor
-
getFullName
Get the type's fully-qualified name.- Specified by:
getFullNamein classDescriptors.GenericDescriptor- See Also:
-
getFile
Get theDescriptors.FileDescriptorcontaining this descriptor.- Specified by:
getFilein classDescriptors.GenericDescriptor
-
getParent
Descriptors.GenericDescriptor getParent()- Specified by:
getParentin classDescriptors.GenericDescriptor
-
getOptions
Get theServiceOptions, defined indescriptor.proto. -
getMethods
Get a list of methods for this service. -
getMethodCount
public int getMethodCount()Get a count of methods for this service. -
getMethod
Get the service's method at the specified index. -
findMethodByName
Find a method by name.- Parameters:
name- the unqualified name of the method such as "Foo"- Returns:
- the method's descriptor, or
nullif not found
-
resolveAllFeatures
See.invalid reference
FileDescriptor#resolveAllFeatures -
crossLink
-
setProto
private void setProto(DescriptorProtos.ServiceDescriptorProto proto) throws Descriptors.DescriptorValidationException
-