Package io.grpc

Class ServiceDescriptor.Builder

    • Field Detail

      • name

        private java.lang.String name
      • schemaDescriptor

        private java.lang.Object schemaDescriptor
    • Constructor Detail

      • Builder

        private Builder​(java.lang.String name)
    • Method Detail

      • setName

        @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2666")
        public ServiceDescriptor.Builder setName​(java.lang.String name)
        Sets the name. This should be non-null.
        Parameters:
        name - The name of the service.
        Returns:
        this builder.
        Since:
        1.1.0
      • addMethod

        public ServiceDescriptor.Builder addMethod​(MethodDescriptor<?,​?> method)
        Adds a method to this service. This should be non-null.
        Parameters:
        method - the method to add to the descriptor.
        Returns:
        this builder.
        Since:
        1.1.0
      • addAllMethods

        private ServiceDescriptor.Builder addAllMethods​(java.util.Collection<MethodDescriptor<?,​?>> methods)
        Currently not exposed. Bulk adds methods to this builder.
        Parameters:
        methods - the methods to add.
        Returns:
        this builder.
      • setSchemaDescriptor

        public ServiceDescriptor.Builder setSchemaDescriptor​(@Nullable
                                                             java.lang.Object schemaDescriptor)
        Sets the schema descriptor for this builder. 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 calling this and the code calling ServiceDescriptor.getSchemaDescriptor() must coordinate. For example, protobuf generated code sets this value, in order to be consumed by the server reflection service.
        Parameters:
        schemaDescriptor - an object that describes the service structure. Should be immutable.
        Returns:
        this builder.
        Since:
        1.1.0