Package io.grpc
Class MethodDescriptor.Builder<ReqT,RespT>
java.lang.Object
io.grpc.MethodDescriptor.Builder<ReqT,RespT>
- Enclosing class:
MethodDescriptor<ReqT,
RespT>
A builder for a
MethodDescriptor
.- Since:
- 1.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the method descriptor.setFullMethodName
(String fullMethodName) Sets the fully qualified (service and method) method name.setIdempotent
(boolean idempotent) Sets whether the method is idempotent.setRequestMarshaller
(MethodDescriptor.Marshaller<ReqT> requestMarshaller) Sets the request marshaller.setResponseMarshaller
(MethodDescriptor.Marshaller<RespT> responseMarshaller) Sets the response marshaller.setSafe
(boolean safe) Sets whether this method is safe.setSampledToLocalTracing
(boolean value) Sets whether RPCs for this method may be sampled into the local tracing store.setSchemaDescriptor
(Object schemaDescriptor) Sets the schema descriptor for this builder.Sets the method type.
-
Method Details
-
setRequestMarshaller
public MethodDescriptor.Builder<ReqT,RespT> setRequestMarshaller(MethodDescriptor.Marshaller<ReqT> requestMarshaller) Sets the request marshaller.- Parameters:
requestMarshaller
- the marshaller to use.- Since:
- 1.1.0
-
setResponseMarshaller
public MethodDescriptor.Builder<ReqT,RespT> setResponseMarshaller(MethodDescriptor.Marshaller<RespT> responseMarshaller) Sets the response marshaller.- Parameters:
responseMarshaller
- the marshaller to use.- Since:
- 1.1.0
-
setType
Sets the method type.- Parameters:
type
- the type of the method.- Since:
- 1.1.0
-
setFullMethodName
Sets the fully qualified (service and method) method name.- Since:
- 1.1.0
- See Also:
-
setSchemaDescriptor
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 methods. The type of the object is specific to the consumer, so both the code calling this and the code callingMethodDescriptor.getSchemaDescriptor()
must coordinate.- Parameters:
schemaDescriptor
- an object that describes the service structure. Should be immutable.- Since:
- 1.7.0
-
setIdempotent
Sets whether the method is idempotent. If true, calling this method more than once doesn't have additional side effects. Iffalse
, method is also not safe. Note that implies callingbuilder.setIdempotent(false).setIdempotent(true)
will leaveisSafe() == false
.- Since:
- 1.1.0
-
setSafe
Sets whether this method is safe. If true, calling this method any number of times doesn't have side effects. Iftrue
, method is also idempotent. Note that implies callingbuilder.setSafe(true).setSafe(false)
will leaveisIdempotent() == true
.- Since:
- 1.1.0
-
setSampledToLocalTracing
Sets whether RPCs for this method may be sampled into the local tracing store. If true, sampled traces of this method may be kept in memory by tracing libraries.- Since:
- 1.8.0
-
build
Builds the method descriptor.- Since:
- 1.1.0
-