Package io.grpc
Class MethodDescriptor.Builder<ReqT,โRespT>
- java.lang.Object
-
- io.grpc.MethodDescriptor.Builder<ReqT,โRespT>
-
- Enclosing class:
- MethodDescriptor<ReqT,โRespT>
public static final class MethodDescriptor.Builder<ReqT,โRespT> extends Object
A builder for aMethodDescriptor
.- Since:
- 1.1.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDescriptor<ReqT,โRespT>
build()
Builds the method descriptor.MethodDescriptor.Builder<ReqT,โRespT>
setFullMethodNameโ(String fullMethodName)
Sets the fully qualified (service and method) method name.MethodDescriptor.Builder<ReqT,โRespT>
setIdempotentโ(boolean idempotent)
Sets whether the method is idempotent.MethodDescriptor.Builder<ReqT,โRespT>
setRequestMarshallerโ(MethodDescriptor.Marshaller<ReqT> requestMarshaller)
Sets the request marshaller.MethodDescriptor.Builder<ReqT,โRespT>
setResponseMarshallerโ(MethodDescriptor.Marshaller<RespT> responseMarshaller)
Sets the response marshaller.MethodDescriptor.Builder<ReqT,โRespT>
setSafeโ(boolean safe)
Sets whether this method is safe.MethodDescriptor.Builder<ReqT,โRespT>
setSampledToLocalTracingโ(boolean value)
Sets whether RPCs for this method may be sampled into the local tracing store.MethodDescriptor.Builder<ReqT,โRespT>
setSchemaDescriptorโ(Object schemaDescriptor)
Sets the schema descriptor for this builder.MethodDescriptor.Builder<ReqT,โRespT>
setTypeโ(MethodDescriptor.MethodType type)
Sets the method type.
-
-
-
Method Detail
-
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
public MethodDescriptor.Builder<ReqT,โRespT> setTypeโ(MethodDescriptor.MethodType type)
Sets the method type.- Parameters:
type
- the type of the method.- Since:
- 1.1.0
-
setFullMethodName
public MethodDescriptor.Builder<ReqT,โRespT> setFullMethodNameโ(String fullMethodName)
Sets the fully qualified (service and method) method name.- Since:
- 1.1.0
- See Also:
MethodDescriptor.generateFullMethodName(java.lang.String, java.lang.String)
-
setSchemaDescriptor
public MethodDescriptor.Builder<ReqT,โRespT> setSchemaDescriptorโ(@Nullable 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 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
public MethodDescriptor.Builder<ReqT,โRespT> setIdempotentโ(boolean idempotent)
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
public MethodDescriptor.Builder<ReqT,โRespT> setSafeโ(boolean safe)
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
public MethodDescriptor.Builder<ReqT,โRespT> setSampledToLocalTracingโ(boolean value)
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
@CheckReturnValue public MethodDescriptor<ReqT,โRespT> build()
Builds the method descriptor.- Since:
- 1.1.0
-
-