Add javadoc to grpc codegen based on proto docs
Fixes #1612
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index 57691bf..535313a 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -15,6 +15,11 @@
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
+/**
+ * <pre>
+ * Test service that supports all call types.
+ * </pre>
+ */
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)",
comments = "Source: test.proto")
@@ -71,34 +76,81 @@
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
+ /**
+ * Creates a new async stub that supports all call types for the service
+ */
public static TestServiceStub newStub(io.grpc.Channel channel) {
return new TestServiceStub(channel);
}
+ /**
+ * Creates a new blocking-style stub that supports unary and streaming output calls on the service
+ */
public static TestServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new TestServiceBlockingStub(channel);
}
+ /**
+ * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
+ */
public static TestServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
return new TestServiceFutureStub(channel);
}
+ /**
+ * <pre>
+ * Test service that supports all call types.
+ * </pre>
+ */
public static interface TestService {
+ /**
+ * <pre>
+ * One request followed by one response.
+ * The server returns the client payload as-is.
+ * </pre>
+ */
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
+ /**
+ * <pre>
+ * One request followed by a sequence of responses (streamed download).
+ * The server returns the payload with client desired type and sizes.
+ * </pre>
+ */
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
+ /**
+ * <pre>
+ * A sequence of requests followed by one response (streamed upload).
+ * The server returns the aggregated size of client payload as the result.
+ * </pre>
+ */
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
+ /**
+ * <pre>
+ * A sequence of requests with each request served by the server immediately.
+ * As one request could lead to multiple responses, this interface
+ * demonstrates the idea of full bidirectionality.
+ * </pre>
+ */
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
+ /**
+ * <pre>
+ * A sequence of requests followed by a sequence of responses.
+ * The server buffers all the client requests and then serves them in order. A
+ * stream of responses are returned to the client when the server starts with
+ * first request.
+ * </pre>
+ */
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
}
@@ -141,16 +193,44 @@
}
}
+ /**
+ * <pre>
+ * Test service that supports all call types.
+ * </pre>
+ */
public static interface TestServiceBlockingClient {
+ /**
+ * <pre>
+ * One request followed by one response.
+ * The server returns the client payload as-is.
+ * </pre>
+ */
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
+ /**
+ * <pre>
+ * One request followed by a sequence of responses (streamed download).
+ * The server returns the payload with client desired type and sizes.
+ * </pre>
+ */
public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
}
+ /**
+ * <pre>
+ * Test service that supports all call types.
+ * </pre>
+ */
public static interface TestServiceFutureClient {
+ /**
+ * <pre>
+ * One request followed by one response.
+ * The server returns the client payload as-is.
+ * </pre>
+ */
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
io.grpc.testing.integration.Test.SimpleRequest request);
}