@Test public void toStringTest() { MethodDescriptor<String, String> descriptor = MethodDescriptor.<String, String>newBuilder() .setType(MethodType.UNARY) .setFullMethodName("package.service/method") .setRequestMarshaller(StringMarshaller.INSTANCE) .setResponseMarshaller(StringMarshaller.INSTANCE) .setSampledToLocalTracing(true) .setIdempotent(true) .setSafe(true) .setSchemaDescriptor(new Object()) .build(); String toString = descriptor.toString(); assertTrue(toString.contains("MethodDescriptor")); assertTrue(toString.contains("fullMethodName=package.service/method")); assertTrue(toString.contains("type=UNARY")); assertTrue(toString.contains("idempotent=true")); assertTrue(toString.contains("safe=true")); assertTrue(toString.contains("sampledToLocalTracing=true")); assertTrue(toString.contains("requestMarshaller=io.grpc.StringMarshaller")); assertTrue(toString.contains("responseMarshaller=io.grpc.StringMarshaller")); assertTrue(toString.contains("schemaDescriptor=java.lang.Object")); }
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("fullMethodName", fullMethodName) .add("type", type) .add("idempotent", idempotent) .add("safe", safe) .add("sampledToLocalTracing", sampledToLocalTracing) .add("requestMarshaller", requestMarshaller) .add("responseMarshaller", responseMarshaller) .add("schemaDescriptor", schemaDescriptor) .omitNullValues() .toString(); }
MethodDescriptor { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("fullMethodName", fullMethodName) .add("type", type) .add("idempotent", idempotent) .add("safe", safe) .add("sampledToLocalTracing", sampledToLocalTracing) .add("requestMarshaller", requestMarshaller) .add("responseMarshaller", responseMarshaller) .add("schemaDescriptor", schemaDescriptor) .omitNullValues() .toString(); } }
MethodDescriptor { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("fullMethodName", fullMethodName) .add("type", type) .add("idempotent", idempotent) .add("safe", safe) .add("sampledToLocalTracing", sampledToLocalTracing) .add("requestMarshaller", requestMarshaller) .add("responseMarshaller", responseMarshaller) .add("schemaDescriptor", schemaDescriptor) .omitNullValues() .toString(); } private  MethodDescriptor(
      MethodType type,
      String fullMethodName,
      Marshaller<ReqT> requestMarshaller,
      Marshaller<RespT> responseMarshaller,
      Object schemaDescriptor,
      boolean idempotent,
      boolean safe,
      boolean sampledToLocalTracing); }
MethodDescriptor { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("fullMethodName", fullMethodName) .add("type", type) .add("idempotent", idempotent) .add("safe", safe) .add("sampledToLocalTracing", sampledToLocalTracing) .add("requestMarshaller", requestMarshaller) .add("responseMarshaller", responseMarshaller) .add("schemaDescriptor", schemaDescriptor) .omitNullValues() .toString(); } private  MethodDescriptor(
      MethodType type,
      String fullMethodName,
      Marshaller<ReqT> requestMarshaller,
      Marshaller<RespT> responseMarshaller,
      Object schemaDescriptor,
      boolean idempotent,
      boolean safe,
      boolean sampledToLocalTracing); @Deprecated static MethodDescriptor<RequestT, ResponseT> create(
      MethodType type, String fullMethodName,
      Marshaller<RequestT> requestMarshaller,
      Marshaller<ResponseT> responseMarshaller); MethodType getType(); String getFullMethodName(); RespT parseResponse(InputStream input); InputStream streamRequest(ReqT requestMessage); ReqT parseRequest(InputStream input); InputStream streamResponse(RespT response); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2592") Marshaller<ReqT> getRequestMarshaller(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2592") Marshaller<RespT> getResponseMarshaller(); @Nullable Object getSchemaDescriptor(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1775") boolean isIdempotent(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1775") boolean isSafe(); boolean isSampledToLocalTracing(); static String generateFullMethodName(String fullServiceName, String methodName); @Nullable static String extractFullServiceName(String fullMethodName); @CheckReturnValue static Builder<ReqT, RespT> newBuilder(); @CheckReturnValue static Builder<ReqT, RespT> newBuilder(
      Marshaller<ReqT> requestMarshaller, Marshaller<RespT> responseMarshaller); @CheckReturnValue Builder<ReqT, RespT> toBuilder(); @CheckReturnValue Builder<NewReqT, NewRespT> toBuilder(
      Marshaller<NewReqT> requestMarshaller, Marshaller<NewRespT> responseMarshaller); @Override String toString(); }
MethodDescriptor { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("fullMethodName", fullMethodName) .add("type", type) .add("idempotent", idempotent) .add("safe", safe) .add("sampledToLocalTracing", sampledToLocalTracing) .add("requestMarshaller", requestMarshaller) .add("responseMarshaller", responseMarshaller) .add("schemaDescriptor", schemaDescriptor) .omitNullValues() .toString(); } private  MethodDescriptor(
      MethodType type,
      String fullMethodName,
      Marshaller<ReqT> requestMarshaller,
      Marshaller<RespT> responseMarshaller,
      Object schemaDescriptor,
      boolean idempotent,
      boolean safe,
      boolean sampledToLocalTracing); @Deprecated static MethodDescriptor<RequestT, ResponseT> create(
      MethodType type, String fullMethodName,
      Marshaller<RequestT> requestMarshaller,
      Marshaller<ResponseT> responseMarshaller); MethodType getType(); String getFullMethodName(); RespT parseResponse(InputStream input); InputStream streamRequest(ReqT requestMessage); ReqT parseRequest(InputStream input); InputStream streamResponse(RespT response); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2592") Marshaller<ReqT> getRequestMarshaller(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2592") Marshaller<RespT> getResponseMarshaller(); @Nullable Object getSchemaDescriptor(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1775") boolean isIdempotent(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1775") boolean isSafe(); boolean isSampledToLocalTracing(); static String generateFullMethodName(String fullServiceName, String methodName); @Nullable static String extractFullServiceName(String fullMethodName); @CheckReturnValue static Builder<ReqT, RespT> newBuilder(); @CheckReturnValue static Builder<ReqT, RespT> newBuilder(
      Marshaller<ReqT> requestMarshaller, Marshaller<RespT> responseMarshaller); @CheckReturnValue Builder<ReqT, RespT> toBuilder(); @CheckReturnValue Builder<NewReqT, NewRespT> toBuilder(
      Marshaller<NewReqT> requestMarshaller, Marshaller<NewRespT> responseMarshaller); @Override String toString();  }