Package io.grpc

Class ServiceDescriptor

java.lang.Object
io.grpc.ServiceDescriptor

public final class ServiceDescriptor extends Object
Descriptor for a service.
Since:
1.0.0
  • Constructor Details

    • ServiceDescriptor

      public ServiceDescriptor(String name, MethodDescriptor<?,?>... methods)
      Constructs a new Service Descriptor. Users are encouraged to use newBuilder(java.lang.String) instead.
      Parameters:
      name - The name of the service
      methods - The methods that are part of the service
      Since:
      1.0.0
    • ServiceDescriptor

      public ServiceDescriptor(String name, Collection<MethodDescriptor<?,?>> methods)
      Constructs a new Service Descriptor. Users are encouraged to use newBuilder(java.lang.String) instead.
      Parameters:
      name - The name of the service
      methods - The methods that are part of the service
      Since:
      1.0.0
  • Method Details

    • getName

      public String getName()
      Simple name of the service. It is not an absolute path.
      Since:
      1.0.0
    • getMethods

      public Collection<MethodDescriptor<?,?>> getMethods()
      A collection of MethodDescriptor instances describing the methods exposed by the service.
      Since:
      1.0.0
    • getSchemaDescriptor

      @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2222") public Object getSchemaDescriptor()
      Returns the schema descriptor for this service. A schema descriptor is an object that is not used by gRPC core but includes information related to the service. The type of the object is specific to the consumer, so both the code setting the schema descriptor and the code calling getSchemaDescriptor() must coordinate. For example, protobuf generated code sets this value, in order to be consumed by the server reflection service. See also: io.grpc.protobuf.ProtoFileDescriptorSupplier.
      Since:
      1.1.0
    • newBuilder

      public static ServiceDescriptor.Builder newBuilder(String name)
      Creates a new builder for a ServiceDescriptor.
      Since:
      1.1.0
    • toString

      public String toString()
      Overrides:
      toString in class Object