Package com.google.protobuf
Class Descriptors.ServiceDescriptor
- java.lang.Object
-
- com.google.protobuf.Descriptors.GenericDescriptor
-
- com.google.protobuf.Descriptors.ServiceDescriptor
-
- Enclosing class:
- Descriptors
public static final class Descriptors.ServiceDescriptor extends Descriptors.GenericDescriptor
Describes a service type.
-
-
Field Summary
Fields Modifier and Type Field Description private Descriptors.FileDescriptor
file
private java.lang.String
fullName
private int
index
private Descriptors.MethodDescriptor[]
methods
private DescriptorProtos.ServiceOptions
options
private DescriptorProtos.ServiceDescriptorProto
proto
-
Fields inherited from class com.google.protobuf.Descriptors.GenericDescriptor
features, parent
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ServiceDescriptor(DescriptorProtos.ServiceDescriptorProto proto, Descriptors.FileDescriptor file, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
crossLink()
Descriptors.MethodDescriptor
findMethodByName(java.lang.String name)
Find a method by name.Descriptors.FileDescriptor
getFile()
Get theDescriptors.FileDescriptor
containing this descriptor.java.lang.String
getFullName()
Get the type's fully-qualified name.int
getIndex()
Get the index of this descriptor within its parent.java.util.List<Descriptors.MethodDescriptor>
getMethods()
Get a list of methods for this service.java.lang.String
getName()
Get the type's unqualified name.DescriptorProtos.ServiceOptions
getOptions()
Get theServiceOptions
, defined indescriptor.proto
.private void
resolveAllFeatures()
SeeFileDescriptor#resolveAllFeatures
.private void
setProto(DescriptorProtos.ServiceDescriptorProto proto)
DescriptorProtos.ServiceDescriptorProto
toProto()
Convert the descriptor to its protocol message representation.-
Methods inherited from class com.google.protobuf.Descriptors.GenericDescriptor
getFeatures, hasInferredLegacyProtoFeatures, inferLegacyProtoFeatures, resolveFeatures, validateFeatures
-
-
-
-
Field Detail
-
index
private final int index
-
proto
private DescriptorProtos.ServiceDescriptorProto proto
-
options
private volatile DescriptorProtos.ServiceOptions options
-
fullName
private final java.lang.String fullName
-
file
private final Descriptors.FileDescriptor file
-
methods
private Descriptors.MethodDescriptor[] methods
-
-
Constructor Detail
-
ServiceDescriptor
private ServiceDescriptor(DescriptorProtos.ServiceDescriptorProto proto, Descriptors.FileDescriptor file, int index) throws Descriptors.DescriptorValidationException
-
-
Method Detail
-
getIndex
public int getIndex()
Get the index of this descriptor within its parent. * @see Descriptors.Descriptor#getIndex()
-
toProto
public DescriptorProtos.ServiceDescriptorProto toProto()
Convert the descriptor to its protocol message representation.- Specified by:
toProto
in classDescriptors.GenericDescriptor
-
getName
public java.lang.String getName()
Get the type's unqualified name.- Specified by:
getName
in classDescriptors.GenericDescriptor
-
getFullName
public java.lang.String getFullName()
Get the type's fully-qualified name.- Specified by:
getFullName
in classDescriptors.GenericDescriptor
- See Also:
Descriptors.Descriptor.getFullName()
-
getFile
public Descriptors.FileDescriptor getFile()
Get theDescriptors.FileDescriptor
containing this descriptor.- Specified by:
getFile
in classDescriptors.GenericDescriptor
-
getOptions
public DescriptorProtos.ServiceOptions getOptions()
Get theServiceOptions
, defined indescriptor.proto
.
-
getMethods
public java.util.List<Descriptors.MethodDescriptor> getMethods()
Get a list of methods for this service.
-
findMethodByName
public Descriptors.MethodDescriptor findMethodByName(java.lang.String name)
Find a method by name.- Parameters:
name
- the unqualified name of the method such as "Foo"- Returns:
- the method's descriptor, or
null
if not found
-
resolveAllFeatures
private void resolveAllFeatures() throws Descriptors.DescriptorValidationException
SeeFileDescriptor#resolveAllFeatures
.
-
crossLink
private void crossLink() throws Descriptors.DescriptorValidationException
-
setProto
private void setProto(DescriptorProtos.ServiceDescriptorProto proto) throws Descriptors.DescriptorValidationException
-
-