diff --git a/src/connector/README.md b/src/connector/README.md index 47b9166f..17bc181c 100644 --- a/src/connector/README.md +++ b/src/connector/README.md @@ -3,12 +3,12 @@ Outline of the code at this point. This is Work-in-Progress. -Current state of the code: Some interop-tests work now. +Current state of the code: All interop-tests work (interop-tests are listed here https://github.com/stanley-cheung/grpc-web/blob/add-interop/test/interop/README.md - To ru nthe interop-tests with this code, do the following - 1. mvn test. This brings ip a Test Service + grpc-web in-process proxy + To run the interop-tests with this code, do the following + 1. mvn package. This brings ip a Test Service + grpc-web in-process proxy 2. Run the client as documented here: https://github.com/stanley-cheung/grpc-web/blob/add-interop/test/interop/README.md#run-the-grpc-web-browser-client @@ -17,6 +17,5 @@ Current state of the code: Some interop-tests work now. 5. It should show the following: EmptyUnary: passed LargeUnary: passed - (and then some errors on the other tests which are not yet implemented in - this grpc-web java proxy code.. working on it) + etc for all tests diff --git a/src/connector/pom.xml b/src/connector/pom.xml index ee684116..9dcb8775 100644 --- a/src/connector/pom.xml +++ b/src/connector/pom.xml @@ -17,6 +17,16 @@ + + com.google.guava + guava + 27.0.1-jre + + + com.google.protobuf + protobuf-java + 3.11.4 + org.eclipse.jetty jetty-maven-plugin @@ -75,6 +85,24 @@ + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.5.0 + + com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:1.7.0:exe:${os.detected.classifier} + + + + + compile + compile-custom + + + + org.codehaus.mojo exec-maven-plugin diff --git a/src/connector/src/main/java/com/google/grpcweb/Factory.java b/src/connector/src/main/java/com/google/grpcweb/Factory.java index fe060703..a214d1c2 100644 --- a/src/connector/src/main/java/com/google/grpcweb/Factory.java +++ b/src/connector/src/main/java/com/google/grpcweb/Factory.java @@ -7,8 +7,8 @@ * This is primarily to make unittesting easier for callers of objects supplied by this factory. */ public class Factory { - private final GrpcServiceConnectionManager mGrpcServiceConnectionManager; private static Factory mInstance; + private int mGrpPortNum; public synchronized static void createSingleton(int grpcPortNum) { if (mInstance == null) { @@ -19,10 +19,10 @@ public synchronized static void createSingleton(int grpcPortNum) { static Factory getInstance() { return mInstance;} private Factory(int grpcPortNum) { - mGrpcServiceConnectionManager = new GrpcServiceConnectionManager(grpcPortNum); + mGrpPortNum = grpcPortNum; } GrpcServiceConnectionManager getGrpcServiceConnectionManager() { - return mGrpcServiceConnectionManager; + return new GrpcServiceConnectionManager(mGrpPortNum); } } diff --git a/src/connector/src/main/java/com/google/grpcweb/GrpcServiceConnectionManager.java b/src/connector/src/main/java/com/google/grpcweb/GrpcServiceConnectionManager.java index 2bfb49dd..a48a7a4f 100644 --- a/src/connector/src/main/java/com/google/grpcweb/GrpcServiceConnectionManager.java +++ b/src/connector/src/main/java/com/google/grpcweb/GrpcServiceConnectionManager.java @@ -1,10 +1,12 @@ package com.google.grpcweb; +import io.grpc.Channel; +import io.grpc.ClientInterceptors; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; /** - * Manages the connection pool to talk to the grpc-service + * TODO: Manage the connection pool to talk to the grpc-service */ class GrpcServiceConnectionManager { private final int mGrpcPortNum; @@ -13,10 +15,14 @@ class GrpcServiceConnectionManager { mGrpcPortNum = grpcPortNum; } - ManagedChannel getChannel() { + private ManagedChannel getManagedChannel() { // TODO: Manage a connection pool. return ManagedChannelBuilder.forAddress("localhost", mGrpcPortNum) .usePlaintext() .build(); } + + Channel getChannelWithClientInterceptor(GrpcWebClientInterceptor interceptor) { + return ClientInterceptors.intercept(getManagedChannel(), interceptor); + } } diff --git a/src/connector/src/main/java/com/google/grpcweb/GrpcWebClientInterceptor.java b/src/connector/src/main/java/com/google/grpcweb/GrpcWebClientInterceptor.java new file mode 100644 index 00000000..cbb9b399 --- /dev/null +++ b/src/connector/src/main/java/com/google/grpcweb/GrpcWebClientInterceptor.java @@ -0,0 +1,68 @@ +package com.google.grpcweb; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientCall.Listener; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.util.concurrent.CountDownLatch; +import java.util.logging.Logger; +import javax.servlet.http.HttpServletResponse; + +class GrpcWebClientInterceptor implements ClientInterceptor { + private static final Logger LOG = Logger.getLogger(GrpcWebClientInterceptor.class.getName()); + private final CountDownLatch mLatch; + private final HttpServletResponse mResp; + private final SendResponse mSendResponse; + + GrpcWebClientInterceptor(HttpServletResponse resp, CountDownLatch latch, SendResponse send) { + mLatch = latch; + mResp = resp; + mSendResponse = send; + } + + @Override + public ClientCall interceptCall(MethodDescriptor method, + CallOptions callOptions, Channel channel) { + return new SimpleForwardingClientCall(channel.newCall(method, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start(new MetadataResponseListener(responseListener), headers); + } + }; + } + + class MetadataResponseListener extends SimpleForwardingClientCallListener { + private boolean headersSent = false; + + MetadataResponseListener(Listener responseListener) { + super(responseListener); + } + + @Override + public void onHeaders(Metadata h) { + mSendResponse.writeHeaders(h); + headersSent = true; + } + + @Override + public void onClose(Status s, Metadata t) { + if (!headersSent) { + // seems, sometimes onHeaders() is not called before this method is called! + // so far, they are the error cases. let onError() method in ClientListener + // handle this call. Could ignore this. + // TODO is this correct? what if onError() never gets called? maybe here it should + // be handled: send headers first and then send the trailers. + } else { + mSendResponse.writeTrailer(s, t); + mLatch.countDown(); + } + super.onClose(s, t); + } + } +} diff --git a/src/connector/src/main/java/com/google/grpcweb/GrpcWebTrafficServlet.java b/src/connector/src/main/java/com/google/grpcweb/GrpcWebTrafficServlet.java index 99114517..a5ba76b7 100644 --- a/src/connector/src/main/java/com/google/grpcweb/GrpcWebTrafficServlet.java +++ b/src/connector/src/main/java/com/google/grpcweb/GrpcWebTrafficServlet.java @@ -1,8 +1,5 @@ package com.google.grpcweb; -import com.google.common.annotations.VisibleForTesting; -import java.io.IOException; -import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -14,14 +11,12 @@ public class GrpcWebTrafficServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { + protected void doGet(HttpServletRequest request, HttpServletResponse response) { new RequestHandler(mFactory).handle(request, response); } @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { + protected void doPost(HttpServletRequest request, HttpServletResponse response) { doGet(request, response); } @@ -30,9 +25,4 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) public GrpcWebTrafficServlet() { mFactory = Factory.getInstance(); } - - @VisibleForTesting - GrpcWebTrafficServlet(Factory factory) { - mFactory = factory; - } } diff --git a/src/connector/src/main/java/com/google/grpcweb/MessageHandler.java b/src/connector/src/main/java/com/google/grpcweb/MessageHandler.java index 0ab9f7fc..a9003813 100644 --- a/src/connector/src/main/java/com/google/grpcweb/MessageHandler.java +++ b/src/connector/src/main/java/com/google/grpcweb/MessageHandler.java @@ -5,12 +5,9 @@ import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; -import java.util.logging.Logger; import javax.servlet.http.HttpServletRequest; class MessageHandler { - private static final Logger LOGGER = Logger.getLogger(MessageHandler.class.getName()); - @VisibleForTesting enum ContentType { GRPC_WEB_BINARY, @@ -48,7 +45,6 @@ static ContentType getContentType(String type) { Object getInputProtobufObj(Method rpcMethod, byte[] in) { Class[] inputArgs = rpcMethod.getParameterTypes(); Class inputArgClass = inputArgs[0]; - LOGGER.fine("inputArgClass name: " + inputArgClass.getName()); // use the inputArg classtype to create a protobuf object Method parseFromObj; diff --git a/src/connector/src/main/java/com/google/grpcweb/MetadataUtil.java b/src/connector/src/main/java/com/google/grpcweb/MetadataUtil.java new file mode 100644 index 00000000..1f0d1791 --- /dev/null +++ b/src/connector/src/main/java/com/google/grpcweb/MetadataUtil.java @@ -0,0 +1,73 @@ +package com.google.grpcweb; + +import io.grpc.Metadata; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; + +class MetadataUtil { + private static final String BINARY_HEADER_SUFFIX = "-bin"; + private static final String GRPC_HEADER_PREFIX = "x-grpc-"; + private static final List EXCLUDED = Arrays.asList("x-grpc-web", "content-type", + "grpc-accept-encoding", "grpc-encoding"); + + static Metadata getHtpHeaders(HttpServletRequest req) { + Metadata httpHeaders = new Metadata(); + Enumeration headerNames = req.getHeaderNames(); + if (headerNames == null) { + return httpHeaders; + } + // copy all headers "x-grpc-*" into Metadata + // TODO: do we need to copy all "x-*" headers instead? + while (headerNames.hasMoreElements()) { + String headerName = headerNames.nextElement(); + if (EXCLUDED.contains(headerName.toLowerCase())) { + continue; + } + if (headerName.toLowerCase().startsWith(GRPC_HEADER_PREFIX)) { + // Get all the values of this header. + Enumeration values = req.getHeaders(headerName); + if (values != null) { + // Java enumerations have klunky API. lets convert to a list. + // this will be a short list usually. + List list = Collections.list(values); + for (String s : list) { + if (headerName.toLowerCase().endsWith(BINARY_HEADER_SUFFIX)) { + // Binary header + httpHeaders.put( + Metadata.Key.of(headerName, Metadata.BINARY_BYTE_MARSHALLER), s.getBytes()); + } else { + // String header + httpHeaders.put( + Metadata.Key.of(headerName, Metadata.ASCII_STRING_MARSHALLER), s); + } + } + } + } + } + return httpHeaders; + } + + static Map getHttpHeadersFromMetadata(Metadata trailer) { + Map map = new HashMap<>(); + for (String key : trailer.keys()) { + if (EXCLUDED.contains(key.toLowerCase())) { + continue; + } + if (key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { + // TODO allow any object type here + byte[] value = trailer.get(Metadata.Key.of(key, Metadata.BINARY_BYTE_MARSHALLER)); + map.put(key, new String(value)); + } else { + String value = trailer.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER)); + map.put(key, value); + } + } + return map; + } +} diff --git a/src/connector/src/main/java/com/google/grpcweb/RequestHandler.java b/src/connector/src/main/java/com/google/grpcweb/RequestHandler.java index 16e41293..54db5e34 100644 --- a/src/connector/src/main/java/com/google/grpcweb/RequestHandler.java +++ b/src/connector/src/main/java/com/google/grpcweb/RequestHandler.java @@ -1,7 +1,9 @@ package com.google.grpcweb; -import io.grpc.ManagedChannel; +import io.grpc.Channel; +import io.grpc.Metadata; import io.grpc.Status; +import io.grpc.stub.MetadataUtils; import io.grpc.stub.StreamObserver; import java.lang.reflect.Method; import java.util.concurrent.CountDownLatch; @@ -14,14 +16,14 @@ import org.apache.commons.lang3.tuple.Pair; class RequestHandler { - private static final Logger LOGGER = Logger.getLogger(RequestHandler.class.getName()); + private static final Logger LOG = Logger.getLogger(RequestHandler.class.getName()); - private final Factory mFactory; private final MessageHandler mMessageHandler; + private final GrpcServiceConnectionManager mGrpcServiceConnectionManager; RequestHandler(Factory factory) { - mFactory = factory; mMessageHandler = new MessageHandler(); + mGrpcServiceConnectionManager = factory.getGrpcServiceConnectionManager(); } public void handle(final HttpServletRequest req, final HttpServletResponse resp) { @@ -42,10 +44,19 @@ public void handle(final HttpServletRequest req, final HttpServletResponse resp) return; } - // get the stubs for the rpc call and the method to be called within the stubs - Object asyncStub = getRpcStub(cls, "newStub"); + // Create a ClientInterceptor object + CountDownLatch latch = new CountDownLatch(1); + GrpcWebClientInterceptor interceptor = + new GrpcWebClientInterceptor(resp, latch, sendResponse); + Channel channel = mGrpcServiceConnectionManager.getChannelWithClientInterceptor(interceptor); + + // get the stub for the rpc call and the method to be called within the stub + io.grpc.stub.AbstractStub asyncStub = getRpcStub(channel, cls, "newStub"); + Metadata headers = MetadataUtil.getHtpHeaders(req); + if (!headers.keys().isEmpty()) { + asyncStub = MetadataUtils.attachHeaders(asyncStub, headers); + } Method asyncStubCall = getRpcMethod(asyncStub, methodName); - // Get the input object bytes ServletInputStream in = req.getInputStream(); MessageDeframer deframer = new MessageDeframer(); @@ -55,12 +66,13 @@ public void handle(final HttpServletRequest req, final HttpServletResponse resp) } // Invoke the rpc call - CountDownLatch latch = new CountDownLatch(1); asyncStubCall.invoke(asyncStub, inObj, new GrpcCallResponseReceiver(sendResponse, latch)); - latch.await(500, TimeUnit.MILLISECONDS); + if (!latch.await(500, TimeUnit.MILLISECONDS)) { + LOG.warning("grpc call took too long!"); + } } catch (Exception e) { - LOGGER.info(e.getMessage()); + LOG.info("Exception occurred: " + e.getMessage()); resp.setStatus(HttpServletResponse.SC_BAD_REQUEST); } } @@ -86,18 +98,17 @@ private Class getClassObject(String className) { try { rpcClass = Class.forName(className + "Grpc"); } catch (ClassNotFoundException e) { - LOGGER.info("no such class " + className); + LOG.info("no such class " + className); } return rpcClass; } - private Object getRpcStub(Class cls, String stubName) { + private io.grpc.stub.AbstractStub getRpcStub(Channel ch, Class cls, String stubName) { try { Method m = cls.getDeclaredMethod(stubName, io.grpc.Channel.class); - ManagedChannel channel = mFactory.getGrpcServiceConnectionManager().getChannel(); - return m.invoke(null, channel); + return (io.grpc.stub.AbstractStub) m.invoke(null, ch); } catch (Exception e) { - LOGGER.warning("Error when fetching " + stubName + " for: " + cls.getName()); + LOG.warning("Error when fetching " + stubName + " for: " + cls.getName()); throw new IllegalArgumentException(e); } } @@ -133,15 +144,13 @@ public void onNext(java.lang.Object resp) { @Override public void onError(Throwable t) { Status s = Status.fromThrowable(t); - LOGGER.info("status is " + s.toString()); sendResponse.writeError(s); latch.countDown(); } @Override public void onCompleted() { - sendResponse.writeGrpcStatusTrailer(Status.OK); - sendResponse.writeOk(); + sendResponse.writeStatusTrailer(Status.OK); latch.countDown(); } } diff --git a/src/connector/src/main/java/com/google/grpcweb/SendResponse.java b/src/connector/src/main/java/com/google/grpcweb/SendResponse.java index f920e4b7..6128f3ff 100644 --- a/src/connector/src/main/java/com/google/grpcweb/SendResponse.java +++ b/src/connector/src/main/java/com/google/grpcweb/SendResponse.java @@ -1,8 +1,10 @@ package com.google.grpcweb; import com.google.grpcweb.MessageHandler.ContentType; +import io.grpc.Metadata; import io.grpc.Status; import java.io.IOException; +import java.util.Map; import java.util.logging.Logger; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; @@ -14,48 +16,68 @@ class SendResponse { private final String mContentType; private final HttpServletResponse mResp; + private boolean isFinalResponseSent = false; SendResponse(HttpServletRequest req, HttpServletResponse resp) { mContentType = req.getContentType(); mResp = resp; } - /** - * Write response out. - */ - void writeResponse(byte[] out) { - setHeaders(); - writeResponse(out, MessageFramer.Type.DATA); + + synchronized void writeHeaders(Metadata headers) { + if (isFinalResponseSent) return; + mResp.setContentType(mContentType); + mResp.setHeader("transfer-encoding", "chunked"); + mResp.setHeader("trailer", "grpc-status,grpc-message"); + if (headers == null) return; + Map ht = MetadataUtil.getHttpHeadersFromMetadata(headers); + StringBuffer sb = new StringBuffer(); + for (String key : ht.keySet()) { + mResp.setHeader(key, ht.get(key)); + } } - void returnUnimplementedStatusCode() { - setHeaders(); - writeGrpcStatusTrailer(Status.UNIMPLEMENTED); - writeOk(); + synchronized void returnUnimplementedStatusCode() { + if (isFinalResponseSent) return; + writeHeaders(null); + writeStatusTrailer(Status.UNIMPLEMENTED); + isFinalResponseSent = true; } - void writeOk() { - mResp.setStatus(HttpServletResponse.SC_OK); + synchronized void writeError(Status s) { + if (isFinalResponseSent) return; + writeHeaders(null); + writeStatusTrailer(s); + isFinalResponseSent = true; } - private void setHeaders() { - mResp.setContentType(mContentType); - mResp.setHeader("transfer-encoding", "chunked"); - mResp.setHeader("trailer", "grpc-status,grpc-message"); + synchronized void writeStatusTrailer(Status status) { + writeTrailer(status, null); } - void writeError(Status s) { - setHeaders(); - writeGrpcStatusTrailer(s); + synchronized void writeTrailer(Status status, Metadata trailer) { + if (isFinalResponseSent) return; + StringBuffer sb = new StringBuffer(); + if (trailer != null) { + Map ht = MetadataUtil.getHttpHeadersFromMetadata(trailer); + for (String key : ht.keySet()) { + sb.append(String.format("%s:%s\r\n", key, ht.get(key))); + } + } + sb.append(String.format("grpc-status:%d\r\n", status.getCode().value())); + if (status.getDescription() != null && !status.getDescription().isEmpty()) { + sb.append(String.format("grpc-message:%s\r\n", status.getDescription())); + } + LOG.fine("writing trailer: " + sb.toString()); + writeResponse(sb.toString().getBytes(), MessageFramer.Type.TRAILER); writeOk(); } - void writeGrpcStatusTrailer(Status status) { - String trailer = String.format("grpc-status:%d\r\ngrpc-message:%s\r\n", - status.getCode().value(), status.getDescription()); - writeResponse(trailer.getBytes(), MessageFramer.Type.TRAILER); + synchronized void writeResponse(byte[] out) { + writeResponse(out, MessageFramer.Type.DATA); } private void writeResponse(byte[] out, MessageFramer.Type type) { + if (isFinalResponseSent) return; try { // PUNT multiple frames not handled byte[] prefix = new MessageFramer().getPrefix(out, type); @@ -72,11 +94,12 @@ private void writeResponse(byte[] out, MessageFramer.Type type) { } } catch (IOException e) { // TODO what to do here? - LOG.info("can't write?"); + LOG.warning("can't write?"); } } - private void logPrefix(byte[] p) { - LOG.info("LENGTH : " + p.length + ", " + p[0] + ", " + p[1] + ", " + p[2] + ", " + p[3] + ", " + p[4]); + private void writeOk() { + mResp.setStatus(HttpServletResponse.SC_OK); + isFinalResponseSent = true; } } diff --git a/src/connector/src/main/java/grpc/testing/EmptyOuterClass.java b/src/connector/src/main/java/grpc/testing/EmptyOuterClass.java deleted file mode 100644 index 49263481..00000000 --- a/src/connector/src/main/java/grpc/testing/EmptyOuterClass.java +++ /dev/null @@ -1,462 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: grpc/testing/empty.proto - -package grpc.testing; - -/** - * ******* DO NOT EDIT ******* - * Generated by proto compiler from protos in the following dir - * https://github.com/grpc/grpc/tree/master/src/proto/grpc/testing - */ -public final class EmptyOuterClass { - private EmptyOuterClass() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - public interface EmptyOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.Empty) - com.google.protobuf.MessageOrBuilder { - } - /** - *
-   * An empty message that you can re-use to avoid defining duplicated empty
-   * messages in your project. A typical example is to use it as argument or the
-   * return value of a service API. For instance:
-   *   service Foo {
-   *     rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
-   *   };
-   * 
- * - * Protobuf type {@code grpc.testing.Empty} - */ - public static final class Empty extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.Empty) - EmptyOrBuilder { - private static final long serialVersionUID = 0L; - // Use Empty.newBuilder() to construct. - private Empty(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Empty() { - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Empty( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.EmptyOuterClass.internal_static_grpc_testing_Empty_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.EmptyOuterClass.internal_static_grpc_testing_Empty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.EmptyOuterClass.Empty.class, grpc.testing.EmptyOuterClass.Empty.Builder.class); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.EmptyOuterClass.Empty)) { - return super.equals(obj); - } - grpc.testing.EmptyOuterClass.Empty other = (grpc.testing.EmptyOuterClass.Empty) obj; - - boolean result = true; - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.EmptyOuterClass.Empty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.EmptyOuterClass.Empty parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.EmptyOuterClass.Empty parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.EmptyOuterClass.Empty prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * An empty message that you can re-use to avoid defining duplicated empty
-     * messages in your project. A typical example is to use it as argument or the
-     * return value of a service API. For instance:
-     *   service Foo {
-     *     rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
-     *   };
-     * 
- * - * Protobuf type {@code grpc.testing.Empty} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.Empty) - grpc.testing.EmptyOuterClass.EmptyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.EmptyOuterClass.internal_static_grpc_testing_Empty_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.EmptyOuterClass.internal_static_grpc_testing_Empty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.EmptyOuterClass.Empty.class, grpc.testing.EmptyOuterClass.Empty.Builder.class); - } - - // Construct using grpc.testing.EmptyOuterClass.Empty.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.EmptyOuterClass.internal_static_grpc_testing_Empty_descriptor; - } - - public grpc.testing.EmptyOuterClass.Empty getDefaultInstanceForType() { - return grpc.testing.EmptyOuterClass.Empty.getDefaultInstance(); - } - - public grpc.testing.EmptyOuterClass.Empty build() { - grpc.testing.EmptyOuterClass.Empty result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.EmptyOuterClass.Empty buildPartial() { - grpc.testing.EmptyOuterClass.Empty result = new grpc.testing.EmptyOuterClass.Empty(this); - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.EmptyOuterClass.Empty) { - return mergeFrom((grpc.testing.EmptyOuterClass.Empty)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.EmptyOuterClass.Empty other) { - if (other == grpc.testing.EmptyOuterClass.Empty.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.EmptyOuterClass.Empty parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.EmptyOuterClass.Empty) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.Empty) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.Empty) - private static final grpc.testing.EmptyOuterClass.Empty DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.EmptyOuterClass.Empty(); - } - - public static grpc.testing.EmptyOuterClass.Empty getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Empty parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Empty(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.EmptyOuterClass.Empty getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_Empty_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_Empty_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\030grpc/testing/empty.proto\022\014grpc.testing" + - "\"\007\n\005Emptyb\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_grpc_testing_Empty_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_grpc_testing_Empty_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_Empty_descriptor, - new java.lang.String[] { }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/connector/src/main/java/grpc/testing/Messages.java b/src/connector/src/main/java/grpc/testing/Messages.java deleted file mode 100644 index a0cd53f7..00000000 --- a/src/connector/src/main/java/grpc/testing/Messages.java +++ /dev/null @@ -1,12640 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: grpc/testing/messages.proto - -package grpc.testing; - -/** - * ******* DO NOT EDIT ******* - * Generated by proto compiler from protos in the following dir - * https://github.com/grpc/grpc/tree/master/src/proto/grpc/testing - */ -public final class Messages { - private Messages() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - /** - *
-   * The type of payload that should be returned.
-   * 
- * - * Protobuf enum {@code grpc.testing.PayloadType} - */ - public enum PayloadType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Compressable text format.
-     * 
- * - * COMPRESSABLE = 0; - */ - COMPRESSABLE(0), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Compressable text format.
-     * 
- * - * COMPRESSABLE = 0; - */ - public static final int COMPRESSABLE_VALUE = 0; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PayloadType valueOf(int value) { - return forNumber(value); - } - - public static PayloadType forNumber(int value) { - switch (value) { - case 0: return COMPRESSABLE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - PayloadType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PayloadType findValueByNumber(int number) { - return PayloadType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return grpc.testing.Messages.getDescriptor().getEnumTypes().get(0); - } - - private static final PayloadType[] VALUES = values(); - - public static PayloadType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private PayloadType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:grpc.testing.PayloadType) - } - - /** - *
-   * The type of route that a client took to reach a server w.r.t. gRPCLB.
-   * The server must fill in "fallback" if it detects that the RPC reached
-   * the server via the "gRPCLB fallback" path, and "backend" if it detects
-   * that the RPC reached the server via "gRPCLB backend" path (i.e. if it got
-   * the address of this server from the gRPCLB server BalanceLoad RPC). Exactly
-   * how this detection is done is context and server dependent.
-   * 
- * - * Protobuf enum {@code grpc.testing.GrpclbRouteType} - */ - public enum GrpclbRouteType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Server didn't detect the route that a client took to reach it.
-     * 
- * - * GRPCLB_ROUTE_TYPE_UNKNOWN = 0; - */ - GRPCLB_ROUTE_TYPE_UNKNOWN(0), - /** - *
-     * Indicates that a client reached a server via gRPCLB fallback.
-     * 
- * - * GRPCLB_ROUTE_TYPE_FALLBACK = 1; - */ - GRPCLB_ROUTE_TYPE_FALLBACK(1), - /** - *
-     * Indicates that a client reached a server as a gRPCLB-given backend.
-     * 
- * - * GRPCLB_ROUTE_TYPE_BACKEND = 2; - */ - GRPCLB_ROUTE_TYPE_BACKEND(2), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Server didn't detect the route that a client took to reach it.
-     * 
- * - * GRPCLB_ROUTE_TYPE_UNKNOWN = 0; - */ - public static final int GRPCLB_ROUTE_TYPE_UNKNOWN_VALUE = 0; - /** - *
-     * Indicates that a client reached a server via gRPCLB fallback.
-     * 
- * - * GRPCLB_ROUTE_TYPE_FALLBACK = 1; - */ - public static final int GRPCLB_ROUTE_TYPE_FALLBACK_VALUE = 1; - /** - *
-     * Indicates that a client reached a server as a gRPCLB-given backend.
-     * 
- * - * GRPCLB_ROUTE_TYPE_BACKEND = 2; - */ - public static final int GRPCLB_ROUTE_TYPE_BACKEND_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static GrpclbRouteType valueOf(int value) { - return forNumber(value); - } - - public static GrpclbRouteType forNumber(int value) { - switch (value) { - case 0: return GRPCLB_ROUTE_TYPE_UNKNOWN; - case 1: return GRPCLB_ROUTE_TYPE_FALLBACK; - case 2: return GRPCLB_ROUTE_TYPE_BACKEND; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - GrpclbRouteType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public GrpclbRouteType findValueByNumber(int number) { - return GrpclbRouteType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return grpc.testing.Messages.getDescriptor().getEnumTypes().get(1); - } - - private static final GrpclbRouteType[] VALUES = values(); - - public static GrpclbRouteType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private GrpclbRouteType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:grpc.testing.GrpclbRouteType) - } - - public interface BoolValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.BoolValue) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The bool value.
-     * 
- * - * bool value = 1; - */ - boolean getValue(); - } - /** - *
-   * TODO(dgq): Go back to using well-known types once
-   * https://github.com/grpc/grpc/issues/6980 has been fixed.
-   * import "google/protobuf/wrappers.proto";
-   * 
- * - * Protobuf type {@code grpc.testing.BoolValue} - */ - public static final class BoolValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.BoolValue) - BoolValueOrBuilder { - private static final long serialVersionUID = 0L; - // Use BoolValue.newBuilder() to construct. - private BoolValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BoolValue() { - value_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BoolValue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - value_ = input.readBool(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_BoolValue_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_BoolValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.BoolValue.class, grpc.testing.Messages.BoolValue.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private boolean value_; - /** - *
-     * The bool value.
-     * 
- * - * bool value = 1; - */ - public boolean getValue() { - return value_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (value_ != false) { - output.writeBool(1, value_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (value_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.BoolValue)) { - return super.equals(obj); - } - grpc.testing.Messages.BoolValue other = (grpc.testing.Messages.BoolValue) obj; - - boolean result = true; - result = result && (getValue() - == other.getValue()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getValue()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.BoolValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.BoolValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.BoolValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.BoolValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.BoolValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.BoolValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.BoolValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.BoolValue parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.BoolValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.BoolValue parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.BoolValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.BoolValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.BoolValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * TODO(dgq): Go back to using well-known types once
-     * https://github.com/grpc/grpc/issues/6980 has been fixed.
-     * import "google/protobuf/wrappers.proto";
-     * 
- * - * Protobuf type {@code grpc.testing.BoolValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.BoolValue) - grpc.testing.Messages.BoolValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_BoolValue_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_BoolValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.BoolValue.class, grpc.testing.Messages.BoolValue.Builder.class); - } - - // Construct using grpc.testing.Messages.BoolValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - value_ = false; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_BoolValue_descriptor; - } - - public grpc.testing.Messages.BoolValue getDefaultInstanceForType() { - return grpc.testing.Messages.BoolValue.getDefaultInstance(); - } - - public grpc.testing.Messages.BoolValue build() { - grpc.testing.Messages.BoolValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.BoolValue buildPartial() { - grpc.testing.Messages.BoolValue result = new grpc.testing.Messages.BoolValue(this); - result.value_ = value_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.BoolValue) { - return mergeFrom((grpc.testing.Messages.BoolValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.BoolValue other) { - if (other == grpc.testing.Messages.BoolValue.getDefaultInstance()) return this; - if (other.getValue() != false) { - setValue(other.getValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.BoolValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.BoolValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean value_ ; - /** - *
-       * The bool value.
-       * 
- * - * bool value = 1; - */ - public boolean getValue() { - return value_; - } - /** - *
-       * The bool value.
-       * 
- * - * bool value = 1; - */ - public Builder setValue(boolean value) { - - value_ = value; - onChanged(); - return this; - } - /** - *
-       * The bool value.
-       * 
- * - * bool value = 1; - */ - public Builder clearValue() { - - value_ = false; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.BoolValue) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.BoolValue) - private static final grpc.testing.Messages.BoolValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.BoolValue(); - } - - public static grpc.testing.Messages.BoolValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public BoolValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BoolValue(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.BoolValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PayloadOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.Payload) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The type of data in body.
-     * 
- * - * .grpc.testing.PayloadType type = 1; - */ - int getTypeValue(); - /** - *
-     * The type of data in body.
-     * 
- * - * .grpc.testing.PayloadType type = 1; - */ - grpc.testing.Messages.PayloadType getType(); - - /** - *
-     * Primary contents of payload.
-     * 
- * - * bytes body = 2; - */ - com.google.protobuf.ByteString getBody(); - } - /** - *
-   * A block of data, to simply increase gRPC message size.
-   * 
- * - * Protobuf type {@code grpc.testing.Payload} - */ - public static final class Payload extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.Payload) - PayloadOrBuilder { - private static final long serialVersionUID = 0L; - // Use Payload.newBuilder() to construct. - private Payload(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Payload() { - type_ = 0; - body_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Payload( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 18: { - - body_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_Payload_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_Payload_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.Payload.class, grpc.testing.Messages.Payload.Builder.class); - } - - public static final int TYPE_FIELD_NUMBER = 1; - private int type_; - /** - *
-     * The type of data in body.
-     * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public int getTypeValue() { - return type_; - } - /** - *
-     * The type of data in body.
-     * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public grpc.testing.Messages.PayloadType getType() { - grpc.testing.Messages.PayloadType result = grpc.testing.Messages.PayloadType.valueOf(type_); - return result == null ? grpc.testing.Messages.PayloadType.UNRECOGNIZED : result; - } - - public static final int BODY_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString body_; - /** - *
-     * Primary contents of payload.
-     * 
- * - * bytes body = 2; - */ - public com.google.protobuf.ByteString getBody() { - return body_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (type_ != grpc.testing.Messages.PayloadType.COMPRESSABLE.getNumber()) { - output.writeEnum(1, type_); - } - if (!body_.isEmpty()) { - output.writeBytes(2, body_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (type_ != grpc.testing.Messages.PayloadType.COMPRESSABLE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, type_); - } - if (!body_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, body_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.Payload)) { - return super.equals(obj); - } - grpc.testing.Messages.Payload other = (grpc.testing.Messages.Payload) obj; - - boolean result = true; - result = result && type_ == other.type_; - result = result && getBody() - .equals(other.getBody()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - hash = (37 * hash) + BODY_FIELD_NUMBER; - hash = (53 * hash) + getBody().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.Payload parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.Payload parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.Payload parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.Payload parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.Payload parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.Payload parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.Payload parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.Payload parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.Payload parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.Payload parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.Payload parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.Payload parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.Payload prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * A block of data, to simply increase gRPC message size.
-     * 
- * - * Protobuf type {@code grpc.testing.Payload} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.Payload) - grpc.testing.Messages.PayloadOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_Payload_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_Payload_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.Payload.class, grpc.testing.Messages.Payload.Builder.class); - } - - // Construct using grpc.testing.Messages.Payload.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - type_ = 0; - - body_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_Payload_descriptor; - } - - public grpc.testing.Messages.Payload getDefaultInstanceForType() { - return grpc.testing.Messages.Payload.getDefaultInstance(); - } - - public grpc.testing.Messages.Payload build() { - grpc.testing.Messages.Payload result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.Payload buildPartial() { - grpc.testing.Messages.Payload result = new grpc.testing.Messages.Payload(this); - result.type_ = type_; - result.body_ = body_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.Payload) { - return mergeFrom((grpc.testing.Messages.Payload)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.Payload other) { - if (other == grpc.testing.Messages.Payload.getDefaultInstance()) return this; - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (other.getBody() != com.google.protobuf.ByteString.EMPTY) { - setBody(other.getBody()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.Payload parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.Payload) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int type_ = 0; - /** - *
-       * The type of data in body.
-       * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public int getTypeValue() { - return type_; - } - /** - *
-       * The type of data in body.
-       * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public Builder setTypeValue(int value) { - type_ = value; - onChanged(); - return this; - } - /** - *
-       * The type of data in body.
-       * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public grpc.testing.Messages.PayloadType getType() { - grpc.testing.Messages.PayloadType result = grpc.testing.Messages.PayloadType.valueOf(type_); - return result == null ? grpc.testing.Messages.PayloadType.UNRECOGNIZED : result; - } - /** - *
-       * The type of data in body.
-       * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public Builder setType(grpc.testing.Messages.PayloadType value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-       * The type of data in body.
-       * 
- * - * .grpc.testing.PayloadType type = 1; - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; - /** - *
-       * Primary contents of payload.
-       * 
- * - * bytes body = 2; - */ - public com.google.protobuf.ByteString getBody() { - return body_; - } - /** - *
-       * Primary contents of payload.
-       * 
- * - * bytes body = 2; - */ - public Builder setBody(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - body_ = value; - onChanged(); - return this; - } - /** - *
-       * Primary contents of payload.
-       * 
- * - * bytes body = 2; - */ - public Builder clearBody() { - - body_ = getDefaultInstance().getBody(); - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.Payload) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.Payload) - private static final grpc.testing.Messages.Payload DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.Payload(); - } - - public static grpc.testing.Messages.Payload getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Payload parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Payload(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.Payload getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface EchoStatusOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.EchoStatus) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 code = 1; - */ - int getCode(); - - /** - * string message = 2; - */ - java.lang.String getMessage(); - /** - * string message = 2; - */ - com.google.protobuf.ByteString - getMessageBytes(); - } - /** - *
-   * A protobuf representation for grpc status. This is used by test
-   * clients to specify a status that the server should attempt to return.
-   * 
- * - * Protobuf type {@code grpc.testing.EchoStatus} - */ - public static final class EchoStatus extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.EchoStatus) - EchoStatusOrBuilder { - private static final long serialVersionUID = 0L; - // Use EchoStatus.newBuilder() to construct. - private EchoStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EchoStatus() { - code_ = 0; - message_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EchoStatus( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - code_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - message_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_EchoStatus_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_EchoStatus_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.EchoStatus.class, grpc.testing.Messages.EchoStatus.Builder.class); - } - - public static final int CODE_FIELD_NUMBER = 1; - private int code_; - /** - * int32 code = 1; - */ - public int getCode() { - return code_; - } - - public static final int MESSAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object message_; - /** - * string message = 2; - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - message_ = s; - return s; - } - } - /** - * string message = 2; - */ - public com.google.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (code_ != 0) { - output.writeInt32(1, code_); - } - if (!getMessageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (code_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, code_); - } - if (!getMessageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.EchoStatus)) { - return super.equals(obj); - } - grpc.testing.Messages.EchoStatus other = (grpc.testing.Messages.EchoStatus) obj; - - boolean result = true; - result = result && (getCode() - == other.getCode()); - result = result && getMessage() - .equals(other.getMessage()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CODE_FIELD_NUMBER; - hash = (53 * hash) + getCode(); - hash = (37 * hash) + MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getMessage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.EchoStatus parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.EchoStatus parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.EchoStatus parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.EchoStatus parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.EchoStatus parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.EchoStatus parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.EchoStatus prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * A protobuf representation for grpc status. This is used by test
-     * clients to specify a status that the server should attempt to return.
-     * 
- * - * Protobuf type {@code grpc.testing.EchoStatus} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.EchoStatus) - grpc.testing.Messages.EchoStatusOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_EchoStatus_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_EchoStatus_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.EchoStatus.class, grpc.testing.Messages.EchoStatus.Builder.class); - } - - // Construct using grpc.testing.Messages.EchoStatus.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - code_ = 0; - - message_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_EchoStatus_descriptor; - } - - public grpc.testing.Messages.EchoStatus getDefaultInstanceForType() { - return grpc.testing.Messages.EchoStatus.getDefaultInstance(); - } - - public grpc.testing.Messages.EchoStatus build() { - grpc.testing.Messages.EchoStatus result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.EchoStatus buildPartial() { - grpc.testing.Messages.EchoStatus result = new grpc.testing.Messages.EchoStatus(this); - result.code_ = code_; - result.message_ = message_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.EchoStatus) { - return mergeFrom((grpc.testing.Messages.EchoStatus)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.EchoStatus other) { - if (other == grpc.testing.Messages.EchoStatus.getDefaultInstance()) return this; - if (other.getCode() != 0) { - setCode(other.getCode()); - } - if (!other.getMessage().isEmpty()) { - message_ = other.message_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.EchoStatus parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.EchoStatus) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int code_ ; - /** - * int32 code = 1; - */ - public int getCode() { - return code_; - } - /** - * int32 code = 1; - */ - public Builder setCode(int value) { - - code_ = value; - onChanged(); - return this; - } - /** - * int32 code = 1; - */ - public Builder clearCode() { - - code_ = 0; - onChanged(); - return this; - } - - private java.lang.Object message_ = ""; - /** - * string message = 2; - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - message_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string message = 2; - */ - public com.google.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string message = 2; - */ - public Builder setMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - message_ = value; - onChanged(); - return this; - } - /** - * string message = 2; - */ - public Builder clearMessage() { - - message_ = getDefaultInstance().getMessage(); - onChanged(); - return this; - } - /** - * string message = 2; - */ - public Builder setMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - message_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.EchoStatus) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.EchoStatus) - private static final grpc.testing.Messages.EchoStatus DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.EchoStatus(); - } - - public static grpc.testing.Messages.EchoStatus getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public EchoStatus parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EchoStatus(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.EchoStatus getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface SimpleRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.SimpleRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, server randomly chooses one from other formats.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - int getResponseTypeValue(); - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, server randomly chooses one from other formats.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - grpc.testing.Messages.PayloadType getResponseType(); - - /** - *
-     * Desired payload size in the response from the server.
-     * 
- * - * int32 response_size = 2; - */ - int getResponseSize(); - - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - boolean hasPayload(); - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - grpc.testing.Messages.Payload getPayload(); - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder(); - - /** - *
-     * Whether SimpleResponse should include username.
-     * 
- * - * bool fill_username = 4; - */ - boolean getFillUsername(); - - /** - *
-     * Whether SimpleResponse should include OAuth scope.
-     * 
- * - * bool fill_oauth_scope = 5; - */ - boolean getFillOauthScope(); - - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - boolean hasResponseCompressed(); - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - grpc.testing.Messages.BoolValue getResponseCompressed(); - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - grpc.testing.Messages.BoolValueOrBuilder getResponseCompressedOrBuilder(); - - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - boolean hasResponseStatus(); - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - grpc.testing.Messages.EchoStatus getResponseStatus(); - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - grpc.testing.Messages.EchoStatusOrBuilder getResponseStatusOrBuilder(); - - /** - *
-     * Whether the server should expect this request to be compressed.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - boolean hasExpectCompressed(); - /** - *
-     * Whether the server should expect this request to be compressed.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - grpc.testing.Messages.BoolValue getExpectCompressed(); - /** - *
-     * Whether the server should expect this request to be compressed.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - grpc.testing.Messages.BoolValueOrBuilder getExpectCompressedOrBuilder(); - - /** - *
-     * Whether SimpleResponse should include server_id.
-     * 
- * - * bool fill_server_id = 9; - */ - boolean getFillServerId(); - - /** - *
-     * Whether SimpleResponse should include grpclb_route_type.
-     * 
- * - * bool fill_grpclb_route_type = 10; - */ - boolean getFillGrpclbRouteType(); - } - /** - *
-   * Unary request.
-   * 
- * - * Protobuf type {@code grpc.testing.SimpleRequest} - */ - public static final class SimpleRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.SimpleRequest) - SimpleRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use SimpleRequest.newBuilder() to construct. - private SimpleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SimpleRequest() { - responseType_ = 0; - responseSize_ = 0; - fillUsername_ = false; - fillOauthScope_ = false; - fillServerId_ = false; - fillGrpclbRouteType_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SimpleRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - - responseType_ = rawValue; - break; - } - case 16: { - - responseSize_ = input.readInt32(); - break; - } - case 26: { - grpc.testing.Messages.Payload.Builder subBuilder = null; - if (payload_ != null) { - subBuilder = payload_.toBuilder(); - } - payload_ = input.readMessage(grpc.testing.Messages.Payload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(payload_); - payload_ = subBuilder.buildPartial(); - } - - break; - } - case 32: { - - fillUsername_ = input.readBool(); - break; - } - case 40: { - - fillOauthScope_ = input.readBool(); - break; - } - case 50: { - grpc.testing.Messages.BoolValue.Builder subBuilder = null; - if (responseCompressed_ != null) { - subBuilder = responseCompressed_.toBuilder(); - } - responseCompressed_ = input.readMessage(grpc.testing.Messages.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(responseCompressed_); - responseCompressed_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - grpc.testing.Messages.EchoStatus.Builder subBuilder = null; - if (responseStatus_ != null) { - subBuilder = responseStatus_.toBuilder(); - } - responseStatus_ = input.readMessage(grpc.testing.Messages.EchoStatus.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(responseStatus_); - responseStatus_ = subBuilder.buildPartial(); - } - - break; - } - case 66: { - grpc.testing.Messages.BoolValue.Builder subBuilder = null; - if (expectCompressed_ != null) { - subBuilder = expectCompressed_.toBuilder(); - } - expectCompressed_ = input.readMessage(grpc.testing.Messages.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expectCompressed_); - expectCompressed_ = subBuilder.buildPartial(); - } - - break; - } - case 72: { - - fillServerId_ = input.readBool(); - break; - } - case 80: { - - fillGrpclbRouteType_ = input.readBool(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.SimpleRequest.class, grpc.testing.Messages.SimpleRequest.Builder.class); - } - - public static final int RESPONSE_TYPE_FIELD_NUMBER = 1; - private int responseType_; - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, server randomly chooses one from other formats.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public int getResponseTypeValue() { - return responseType_; - } - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, server randomly chooses one from other formats.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public grpc.testing.Messages.PayloadType getResponseType() { - grpc.testing.Messages.PayloadType result = grpc.testing.Messages.PayloadType.valueOf(responseType_); - return result == null ? grpc.testing.Messages.PayloadType.UNRECOGNIZED : result; - } - - public static final int RESPONSE_SIZE_FIELD_NUMBER = 2; - private int responseSize_; - /** - *
-     * Desired payload size in the response from the server.
-     * 
- * - * int32 response_size = 2; - */ - public int getResponseSize() { - return responseSize_; - } - - public static final int PAYLOAD_FIELD_NUMBER = 3; - private grpc.testing.Messages.Payload payload_; - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - public boolean hasPayload() { - return payload_ != null; - } - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.Payload getPayload() { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - return getPayload(); - } - - public static final int FILL_USERNAME_FIELD_NUMBER = 4; - private boolean fillUsername_; - /** - *
-     * Whether SimpleResponse should include username.
-     * 
- * - * bool fill_username = 4; - */ - public boolean getFillUsername() { - return fillUsername_; - } - - public static final int FILL_OAUTH_SCOPE_FIELD_NUMBER = 5; - private boolean fillOauthScope_; - /** - *
-     * Whether SimpleResponse should include OAuth scope.
-     * 
- * - * bool fill_oauth_scope = 5; - */ - public boolean getFillOauthScope() { - return fillOauthScope_; - } - - public static final int RESPONSE_COMPRESSED_FIELD_NUMBER = 6; - private grpc.testing.Messages.BoolValue responseCompressed_; - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public boolean hasResponseCompressed() { - return responseCompressed_ != null; - } - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public grpc.testing.Messages.BoolValue getResponseCompressed() { - return responseCompressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : responseCompressed_; - } - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public grpc.testing.Messages.BoolValueOrBuilder getResponseCompressedOrBuilder() { - return getResponseCompressed(); - } - - public static final int RESPONSE_STATUS_FIELD_NUMBER = 7; - private grpc.testing.Messages.EchoStatus responseStatus_; - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public boolean hasResponseStatus() { - return responseStatus_ != null; - } - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatus getResponseStatus() { - return responseStatus_ == null ? grpc.testing.Messages.EchoStatus.getDefaultInstance() : responseStatus_; - } - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatusOrBuilder getResponseStatusOrBuilder() { - return getResponseStatus(); - } - - public static final int EXPECT_COMPRESSED_FIELD_NUMBER = 8; - private grpc.testing.Messages.BoolValue expectCompressed_; - /** - *
-     * Whether the server should expect this request to be compressed.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public boolean hasExpectCompressed() { - return expectCompressed_ != null; - } - /** - *
-     * Whether the server should expect this request to be compressed.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public grpc.testing.Messages.BoolValue getExpectCompressed() { - return expectCompressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : expectCompressed_; - } - /** - *
-     * Whether the server should expect this request to be compressed.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public grpc.testing.Messages.BoolValueOrBuilder getExpectCompressedOrBuilder() { - return getExpectCompressed(); - } - - public static final int FILL_SERVER_ID_FIELD_NUMBER = 9; - private boolean fillServerId_; - /** - *
-     * Whether SimpleResponse should include server_id.
-     * 
- * - * bool fill_server_id = 9; - */ - public boolean getFillServerId() { - return fillServerId_; - } - - public static final int FILL_GRPCLB_ROUTE_TYPE_FIELD_NUMBER = 10; - private boolean fillGrpclbRouteType_; - /** - *
-     * Whether SimpleResponse should include grpclb_route_type.
-     * 
- * - * bool fill_grpclb_route_type = 10; - */ - public boolean getFillGrpclbRouteType() { - return fillGrpclbRouteType_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (responseType_ != grpc.testing.Messages.PayloadType.COMPRESSABLE.getNumber()) { - output.writeEnum(1, responseType_); - } - if (responseSize_ != 0) { - output.writeInt32(2, responseSize_); - } - if (payload_ != null) { - output.writeMessage(3, getPayload()); - } - if (fillUsername_ != false) { - output.writeBool(4, fillUsername_); - } - if (fillOauthScope_ != false) { - output.writeBool(5, fillOauthScope_); - } - if (responseCompressed_ != null) { - output.writeMessage(6, getResponseCompressed()); - } - if (responseStatus_ != null) { - output.writeMessage(7, getResponseStatus()); - } - if (expectCompressed_ != null) { - output.writeMessage(8, getExpectCompressed()); - } - if (fillServerId_ != false) { - output.writeBool(9, fillServerId_); - } - if (fillGrpclbRouteType_ != false) { - output.writeBool(10, fillGrpclbRouteType_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (responseType_ != grpc.testing.Messages.PayloadType.COMPRESSABLE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, responseType_); - } - if (responseSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, responseSize_); - } - if (payload_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPayload()); - } - if (fillUsername_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, fillUsername_); - } - if (fillOauthScope_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, fillOauthScope_); - } - if (responseCompressed_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getResponseCompressed()); - } - if (responseStatus_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getResponseStatus()); - } - if (expectCompressed_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getExpectCompressed()); - } - if (fillServerId_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, fillServerId_); - } - if (fillGrpclbRouteType_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(10, fillGrpclbRouteType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.SimpleRequest)) { - return super.equals(obj); - } - grpc.testing.Messages.SimpleRequest other = (grpc.testing.Messages.SimpleRequest) obj; - - boolean result = true; - result = result && responseType_ == other.responseType_; - result = result && (getResponseSize() - == other.getResponseSize()); - result = result && (hasPayload() == other.hasPayload()); - if (hasPayload()) { - result = result && getPayload() - .equals(other.getPayload()); - } - result = result && (getFillUsername() - == other.getFillUsername()); - result = result && (getFillOauthScope() - == other.getFillOauthScope()); - result = result && (hasResponseCompressed() == other.hasResponseCompressed()); - if (hasResponseCompressed()) { - result = result && getResponseCompressed() - .equals(other.getResponseCompressed()); - } - result = result && (hasResponseStatus() == other.hasResponseStatus()); - if (hasResponseStatus()) { - result = result && getResponseStatus() - .equals(other.getResponseStatus()); - } - result = result && (hasExpectCompressed() == other.hasExpectCompressed()); - if (hasExpectCompressed()) { - result = result && getExpectCompressed() - .equals(other.getExpectCompressed()); - } - result = result && (getFillServerId() - == other.getFillServerId()); - result = result && (getFillGrpclbRouteType() - == other.getFillGrpclbRouteType()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RESPONSE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + responseType_; - hash = (37 * hash) + RESPONSE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getResponseSize(); - if (hasPayload()) { - hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; - hash = (53 * hash) + getPayload().hashCode(); - } - hash = (37 * hash) + FILL_USERNAME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFillUsername()); - hash = (37 * hash) + FILL_OAUTH_SCOPE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFillOauthScope()); - if (hasResponseCompressed()) { - hash = (37 * hash) + RESPONSE_COMPRESSED_FIELD_NUMBER; - hash = (53 * hash) + getResponseCompressed().hashCode(); - } - if (hasResponseStatus()) { - hash = (37 * hash) + RESPONSE_STATUS_FIELD_NUMBER; - hash = (53 * hash) + getResponseStatus().hashCode(); - } - if (hasExpectCompressed()) { - hash = (37 * hash) + EXPECT_COMPRESSED_FIELD_NUMBER; - hash = (53 * hash) + getExpectCompressed().hashCode(); - } - hash = (37 * hash) + FILL_SERVER_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFillServerId()); - hash = (37 * hash) + FILL_GRPCLB_ROUTE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFillGrpclbRouteType()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.SimpleRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.SimpleRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.SimpleRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.SimpleRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.SimpleRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.SimpleRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.SimpleRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Unary request.
-     * 
- * - * Protobuf type {@code grpc.testing.SimpleRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.SimpleRequest) - grpc.testing.Messages.SimpleRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.SimpleRequest.class, grpc.testing.Messages.SimpleRequest.Builder.class); - } - - // Construct using grpc.testing.Messages.SimpleRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - responseType_ = 0; - - responseSize_ = 0; - - if (payloadBuilder_ == null) { - payload_ = null; - } else { - payload_ = null; - payloadBuilder_ = null; - } - fillUsername_ = false; - - fillOauthScope_ = false; - - if (responseCompressedBuilder_ == null) { - responseCompressed_ = null; - } else { - responseCompressed_ = null; - responseCompressedBuilder_ = null; - } - if (responseStatusBuilder_ == null) { - responseStatus_ = null; - } else { - responseStatus_ = null; - responseStatusBuilder_ = null; - } - if (expectCompressedBuilder_ == null) { - expectCompressed_ = null; - } else { - expectCompressed_ = null; - expectCompressedBuilder_ = null; - } - fillServerId_ = false; - - fillGrpclbRouteType_ = false; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleRequest_descriptor; - } - - public grpc.testing.Messages.SimpleRequest getDefaultInstanceForType() { - return grpc.testing.Messages.SimpleRequest.getDefaultInstance(); - } - - public grpc.testing.Messages.SimpleRequest build() { - grpc.testing.Messages.SimpleRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.SimpleRequest buildPartial() { - grpc.testing.Messages.SimpleRequest result = new grpc.testing.Messages.SimpleRequest(this); - result.responseType_ = responseType_; - result.responseSize_ = responseSize_; - if (payloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = payloadBuilder_.build(); - } - result.fillUsername_ = fillUsername_; - result.fillOauthScope_ = fillOauthScope_; - if (responseCompressedBuilder_ == null) { - result.responseCompressed_ = responseCompressed_; - } else { - result.responseCompressed_ = responseCompressedBuilder_.build(); - } - if (responseStatusBuilder_ == null) { - result.responseStatus_ = responseStatus_; - } else { - result.responseStatus_ = responseStatusBuilder_.build(); - } - if (expectCompressedBuilder_ == null) { - result.expectCompressed_ = expectCompressed_; - } else { - result.expectCompressed_ = expectCompressedBuilder_.build(); - } - result.fillServerId_ = fillServerId_; - result.fillGrpclbRouteType_ = fillGrpclbRouteType_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.SimpleRequest) { - return mergeFrom((grpc.testing.Messages.SimpleRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.SimpleRequest other) { - if (other == grpc.testing.Messages.SimpleRequest.getDefaultInstance()) return this; - if (other.responseType_ != 0) { - setResponseTypeValue(other.getResponseTypeValue()); - } - if (other.getResponseSize() != 0) { - setResponseSize(other.getResponseSize()); - } - if (other.hasPayload()) { - mergePayload(other.getPayload()); - } - if (other.getFillUsername() != false) { - setFillUsername(other.getFillUsername()); - } - if (other.getFillOauthScope() != false) { - setFillOauthScope(other.getFillOauthScope()); - } - if (other.hasResponseCompressed()) { - mergeResponseCompressed(other.getResponseCompressed()); - } - if (other.hasResponseStatus()) { - mergeResponseStatus(other.getResponseStatus()); - } - if (other.hasExpectCompressed()) { - mergeExpectCompressed(other.getExpectCompressed()); - } - if (other.getFillServerId() != false) { - setFillServerId(other.getFillServerId()); - } - if (other.getFillGrpclbRouteType() != false) { - setFillGrpclbRouteType(other.getFillGrpclbRouteType()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.SimpleRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.SimpleRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int responseType_ = 0; - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, server randomly chooses one from other formats.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public int getResponseTypeValue() { - return responseType_; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, server randomly chooses one from other formats.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public Builder setResponseTypeValue(int value) { - responseType_ = value; - onChanged(); - return this; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, server randomly chooses one from other formats.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public grpc.testing.Messages.PayloadType getResponseType() { - grpc.testing.Messages.PayloadType result = grpc.testing.Messages.PayloadType.valueOf(responseType_); - return result == null ? grpc.testing.Messages.PayloadType.UNRECOGNIZED : result; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, server randomly chooses one from other formats.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public Builder setResponseType(grpc.testing.Messages.PayloadType value) { - if (value == null) { - throw new NullPointerException(); - } - - responseType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, server randomly chooses one from other formats.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public Builder clearResponseType() { - - responseType_ = 0; - onChanged(); - return this; - } - - private int responseSize_ ; - /** - *
-       * Desired payload size in the response from the server.
-       * 
- * - * int32 response_size = 2; - */ - public int getResponseSize() { - return responseSize_; - } - /** - *
-       * Desired payload size in the response from the server.
-       * 
- * - * int32 response_size = 2; - */ - public Builder setResponseSize(int value) { - - responseSize_ = value; - onChanged(); - return this; - } - /** - *
-       * Desired payload size in the response from the server.
-       * 
- * - * int32 response_size = 2; - */ - public Builder clearResponseSize() { - - responseSize_ = 0; - onChanged(); - return this; - } - - private grpc.testing.Messages.Payload payload_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> payloadBuilder_; - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public boolean hasPayload() { - return payloadBuilder_ != null || payload_ != null; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.Payload getPayload() { - if (payloadBuilder_ == null) { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } else { - return payloadBuilder_.getMessage(); - } - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder setPayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - payloadBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder setPayload( - grpc.testing.Messages.Payload.Builder builderForValue) { - if (payloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - payloadBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder mergePayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (payload_ != null) { - payload_ = - grpc.testing.Messages.Payload.newBuilder(payload_).mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - payloadBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder clearPayload() { - if (payloadBuilder_ == null) { - payload_ = null; - onChanged(); - } else { - payload_ = null; - payloadBuilder_ = null; - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.Payload.Builder getPayloadBuilder() { - - onChanged(); - return getPayloadFieldBuilder().getBuilder(); - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - if (payloadBuilder_ != null) { - return payloadBuilder_.getMessageOrBuilder(); - } else { - return payload_ == null ? - grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> - getPayloadFieldBuilder() { - if (payloadBuilder_ == null) { - payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder>( - getPayload(), - getParentForChildren(), - isClean()); - payload_ = null; - } - return payloadBuilder_; - } - - private boolean fillUsername_ ; - /** - *
-       * Whether SimpleResponse should include username.
-       * 
- * - * bool fill_username = 4; - */ - public boolean getFillUsername() { - return fillUsername_; - } - /** - *
-       * Whether SimpleResponse should include username.
-       * 
- * - * bool fill_username = 4; - */ - public Builder setFillUsername(boolean value) { - - fillUsername_ = value; - onChanged(); - return this; - } - /** - *
-       * Whether SimpleResponse should include username.
-       * 
- * - * bool fill_username = 4; - */ - public Builder clearFillUsername() { - - fillUsername_ = false; - onChanged(); - return this; - } - - private boolean fillOauthScope_ ; - /** - *
-       * Whether SimpleResponse should include OAuth scope.
-       * 
- * - * bool fill_oauth_scope = 5; - */ - public boolean getFillOauthScope() { - return fillOauthScope_; - } - /** - *
-       * Whether SimpleResponse should include OAuth scope.
-       * 
- * - * bool fill_oauth_scope = 5; - */ - public Builder setFillOauthScope(boolean value) { - - fillOauthScope_ = value; - onChanged(); - return this; - } - /** - *
-       * Whether SimpleResponse should include OAuth scope.
-       * 
- * - * bool fill_oauth_scope = 5; - */ - public Builder clearFillOauthScope() { - - fillOauthScope_ = false; - onChanged(); - return this; - } - - private grpc.testing.Messages.BoolValue responseCompressed_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> responseCompressedBuilder_; - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public boolean hasResponseCompressed() { - return responseCompressedBuilder_ != null || responseCompressed_ != null; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public grpc.testing.Messages.BoolValue getResponseCompressed() { - if (responseCompressedBuilder_ == null) { - return responseCompressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : responseCompressed_; - } else { - return responseCompressedBuilder_.getMessage(); - } - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public Builder setResponseCompressed(grpc.testing.Messages.BoolValue value) { - if (responseCompressedBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - responseCompressed_ = value; - onChanged(); - } else { - responseCompressedBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public Builder setResponseCompressed( - grpc.testing.Messages.BoolValue.Builder builderForValue) { - if (responseCompressedBuilder_ == null) { - responseCompressed_ = builderForValue.build(); - onChanged(); - } else { - responseCompressedBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public Builder mergeResponseCompressed(grpc.testing.Messages.BoolValue value) { - if (responseCompressedBuilder_ == null) { - if (responseCompressed_ != null) { - responseCompressed_ = - grpc.testing.Messages.BoolValue.newBuilder(responseCompressed_).mergeFrom(value).buildPartial(); - } else { - responseCompressed_ = value; - } - onChanged(); - } else { - responseCompressedBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public Builder clearResponseCompressed() { - if (responseCompressedBuilder_ == null) { - responseCompressed_ = null; - onChanged(); - } else { - responseCompressed_ = null; - responseCompressedBuilder_ = null; - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public grpc.testing.Messages.BoolValue.Builder getResponseCompressedBuilder() { - - onChanged(); - return getResponseCompressedFieldBuilder().getBuilder(); - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - public grpc.testing.Messages.BoolValueOrBuilder getResponseCompressedOrBuilder() { - if (responseCompressedBuilder_ != null) { - return responseCompressedBuilder_.getMessageOrBuilder(); - } else { - return responseCompressed_ == null ? - grpc.testing.Messages.BoolValue.getDefaultInstance() : responseCompressed_; - } - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue response_compressed = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> - getResponseCompressedFieldBuilder() { - if (responseCompressedBuilder_ == null) { - responseCompressedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder>( - getResponseCompressed(), - getParentForChildren(), - isClean()); - responseCompressed_ = null; - } - return responseCompressedBuilder_; - } - - private grpc.testing.Messages.EchoStatus responseStatus_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.EchoStatus, grpc.testing.Messages.EchoStatus.Builder, grpc.testing.Messages.EchoStatusOrBuilder> responseStatusBuilder_; - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public boolean hasResponseStatus() { - return responseStatusBuilder_ != null || responseStatus_ != null; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatus getResponseStatus() { - if (responseStatusBuilder_ == null) { - return responseStatus_ == null ? grpc.testing.Messages.EchoStatus.getDefaultInstance() : responseStatus_; - } else { - return responseStatusBuilder_.getMessage(); - } - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder setResponseStatus(grpc.testing.Messages.EchoStatus value) { - if (responseStatusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - responseStatus_ = value; - onChanged(); - } else { - responseStatusBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder setResponseStatus( - grpc.testing.Messages.EchoStatus.Builder builderForValue) { - if (responseStatusBuilder_ == null) { - responseStatus_ = builderForValue.build(); - onChanged(); - } else { - responseStatusBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder mergeResponseStatus(grpc.testing.Messages.EchoStatus value) { - if (responseStatusBuilder_ == null) { - if (responseStatus_ != null) { - responseStatus_ = - grpc.testing.Messages.EchoStatus.newBuilder(responseStatus_).mergeFrom(value).buildPartial(); - } else { - responseStatus_ = value; - } - onChanged(); - } else { - responseStatusBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder clearResponseStatus() { - if (responseStatusBuilder_ == null) { - responseStatus_ = null; - onChanged(); - } else { - responseStatus_ = null; - responseStatusBuilder_ = null; - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatus.Builder getResponseStatusBuilder() { - - onChanged(); - return getResponseStatusFieldBuilder().getBuilder(); - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatusOrBuilder getResponseStatusOrBuilder() { - if (responseStatusBuilder_ != null) { - return responseStatusBuilder_.getMessageOrBuilder(); - } else { - return responseStatus_ == null ? - grpc.testing.Messages.EchoStatus.getDefaultInstance() : responseStatus_; - } - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.EchoStatus, grpc.testing.Messages.EchoStatus.Builder, grpc.testing.Messages.EchoStatusOrBuilder> - getResponseStatusFieldBuilder() { - if (responseStatusBuilder_ == null) { - responseStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.EchoStatus, grpc.testing.Messages.EchoStatus.Builder, grpc.testing.Messages.EchoStatusOrBuilder>( - getResponseStatus(), - getParentForChildren(), - isClean()); - responseStatus_ = null; - } - return responseStatusBuilder_; - } - - private grpc.testing.Messages.BoolValue expectCompressed_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> expectCompressedBuilder_; - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public boolean hasExpectCompressed() { - return expectCompressedBuilder_ != null || expectCompressed_ != null; - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public grpc.testing.Messages.BoolValue getExpectCompressed() { - if (expectCompressedBuilder_ == null) { - return expectCompressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : expectCompressed_; - } else { - return expectCompressedBuilder_.getMessage(); - } - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public Builder setExpectCompressed(grpc.testing.Messages.BoolValue value) { - if (expectCompressedBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - expectCompressed_ = value; - onChanged(); - } else { - expectCompressedBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public Builder setExpectCompressed( - grpc.testing.Messages.BoolValue.Builder builderForValue) { - if (expectCompressedBuilder_ == null) { - expectCompressed_ = builderForValue.build(); - onChanged(); - } else { - expectCompressedBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public Builder mergeExpectCompressed(grpc.testing.Messages.BoolValue value) { - if (expectCompressedBuilder_ == null) { - if (expectCompressed_ != null) { - expectCompressed_ = - grpc.testing.Messages.BoolValue.newBuilder(expectCompressed_).mergeFrom(value).buildPartial(); - } else { - expectCompressed_ = value; - } - onChanged(); - } else { - expectCompressedBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public Builder clearExpectCompressed() { - if (expectCompressedBuilder_ == null) { - expectCompressed_ = null; - onChanged(); - } else { - expectCompressed_ = null; - expectCompressedBuilder_ = null; - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public grpc.testing.Messages.BoolValue.Builder getExpectCompressedBuilder() { - - onChanged(); - return getExpectCompressedFieldBuilder().getBuilder(); - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - public grpc.testing.Messages.BoolValueOrBuilder getExpectCompressedOrBuilder() { - if (expectCompressedBuilder_ != null) { - return expectCompressedBuilder_.getMessageOrBuilder(); - } else { - return expectCompressed_ == null ? - grpc.testing.Messages.BoolValue.getDefaultInstance() : expectCompressed_; - } - } - /** - *
-       * Whether the server should expect this request to be compressed.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> - getExpectCompressedFieldBuilder() { - if (expectCompressedBuilder_ == null) { - expectCompressedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder>( - getExpectCompressed(), - getParentForChildren(), - isClean()); - expectCompressed_ = null; - } - return expectCompressedBuilder_; - } - - private boolean fillServerId_ ; - /** - *
-       * Whether SimpleResponse should include server_id.
-       * 
- * - * bool fill_server_id = 9; - */ - public boolean getFillServerId() { - return fillServerId_; - } - /** - *
-       * Whether SimpleResponse should include server_id.
-       * 
- * - * bool fill_server_id = 9; - */ - public Builder setFillServerId(boolean value) { - - fillServerId_ = value; - onChanged(); - return this; - } - /** - *
-       * Whether SimpleResponse should include server_id.
-       * 
- * - * bool fill_server_id = 9; - */ - public Builder clearFillServerId() { - - fillServerId_ = false; - onChanged(); - return this; - } - - private boolean fillGrpclbRouteType_ ; - /** - *
-       * Whether SimpleResponse should include grpclb_route_type.
-       * 
- * - * bool fill_grpclb_route_type = 10; - */ - public boolean getFillGrpclbRouteType() { - return fillGrpclbRouteType_; - } - /** - *
-       * Whether SimpleResponse should include grpclb_route_type.
-       * 
- * - * bool fill_grpclb_route_type = 10; - */ - public Builder setFillGrpclbRouteType(boolean value) { - - fillGrpclbRouteType_ = value; - onChanged(); - return this; - } - /** - *
-       * Whether SimpleResponse should include grpclb_route_type.
-       * 
- * - * bool fill_grpclb_route_type = 10; - */ - public Builder clearFillGrpclbRouteType() { - - fillGrpclbRouteType_ = false; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.SimpleRequest) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.SimpleRequest) - private static final grpc.testing.Messages.SimpleRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.SimpleRequest(); - } - - public static grpc.testing.Messages.SimpleRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public SimpleRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SimpleRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.SimpleRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface SimpleResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.SimpleResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Payload to increase message size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - boolean hasPayload(); - /** - *
-     * Payload to increase message size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - grpc.testing.Messages.Payload getPayload(); - /** - *
-     * Payload to increase message size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder(); - - /** - *
-     * The user the request came from, for verifying authentication was
-     * successful when the client expected it.
-     * 
- * - * string username = 2; - */ - java.lang.String getUsername(); - /** - *
-     * The user the request came from, for verifying authentication was
-     * successful when the client expected it.
-     * 
- * - * string username = 2; - */ - com.google.protobuf.ByteString - getUsernameBytes(); - - /** - *
-     * OAuth scope.
-     * 
- * - * string oauth_scope = 3; - */ - java.lang.String getOauthScope(); - /** - *
-     * OAuth scope.
-     * 
- * - * string oauth_scope = 3; - */ - com.google.protobuf.ByteString - getOauthScopeBytes(); - - /** - *
-     * Server ID. This must be unique among different server instances,
-     * but the same across all RPC's made to a particular server instance.
-     * 
- * - * string server_id = 4; - */ - java.lang.String getServerId(); - /** - *
-     * Server ID. This must be unique among different server instances,
-     * but the same across all RPC's made to a particular server instance.
-     * 
- * - * string server_id = 4; - */ - com.google.protobuf.ByteString - getServerIdBytes(); - - /** - *
-     * gRPCLB Path.
-     * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - int getGrpclbRouteTypeValue(); - /** - *
-     * gRPCLB Path.
-     * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - grpc.testing.Messages.GrpclbRouteType getGrpclbRouteType(); - - /** - *
-     * Server hostname.
-     * 
- * - * string hostname = 6; - */ - java.lang.String getHostname(); - /** - *
-     * Server hostname.
-     * 
- * - * string hostname = 6; - */ - com.google.protobuf.ByteString - getHostnameBytes(); - } - /** - *
-   * Unary response, as configured by the request.
-   * 
- * - * Protobuf type {@code grpc.testing.SimpleResponse} - */ - public static final class SimpleResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.SimpleResponse) - SimpleResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use SimpleResponse.newBuilder() to construct. - private SimpleResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SimpleResponse() { - username_ = ""; - oauthScope_ = ""; - serverId_ = ""; - grpclbRouteType_ = 0; - hostname_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SimpleResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - grpc.testing.Messages.Payload.Builder subBuilder = null; - if (payload_ != null) { - subBuilder = payload_.toBuilder(); - } - payload_ = input.readMessage(grpc.testing.Messages.Payload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(payload_); - payload_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - oauthScope_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - serverId_ = s; - break; - } - case 40: { - int rawValue = input.readEnum(); - - grpclbRouteType_ = rawValue; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - hostname_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.SimpleResponse.class, grpc.testing.Messages.SimpleResponse.Builder.class); - } - - public static final int PAYLOAD_FIELD_NUMBER = 1; - private grpc.testing.Messages.Payload payload_; - /** - *
-     * Payload to increase message size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public boolean hasPayload() { - return payload_ != null; - } - /** - *
-     * Payload to increase message size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload getPayload() { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - /** - *
-     * Payload to increase message size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - return getPayload(); - } - - public static final int USERNAME_FIELD_NUMBER = 2; - private volatile java.lang.Object username_; - /** - *
-     * The user the request came from, for verifying authentication was
-     * successful when the client expected it.
-     * 
- * - * string username = 2; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - *
-     * The user the request came from, for verifying authentication was
-     * successful when the client expected it.
-     * 
- * - * string username = 2; - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OAUTH_SCOPE_FIELD_NUMBER = 3; - private volatile java.lang.Object oauthScope_; - /** - *
-     * OAuth scope.
-     * 
- * - * string oauth_scope = 3; - */ - public java.lang.String getOauthScope() { - java.lang.Object ref = oauthScope_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - oauthScope_ = s; - return s; - } - } - /** - *
-     * OAuth scope.
-     * 
- * - * string oauth_scope = 3; - */ - public com.google.protobuf.ByteString - getOauthScopeBytes() { - java.lang.Object ref = oauthScope_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - oauthScope_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVER_ID_FIELD_NUMBER = 4; - private volatile java.lang.Object serverId_; - /** - *
-     * Server ID. This must be unique among different server instances,
-     * but the same across all RPC's made to a particular server instance.
-     * 
- * - * string server_id = 4; - */ - public java.lang.String getServerId() { - java.lang.Object ref = serverId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serverId_ = s; - return s; - } - } - /** - *
-     * Server ID. This must be unique among different server instances,
-     * but the same across all RPC's made to a particular server instance.
-     * 
- * - * string server_id = 4; - */ - public com.google.protobuf.ByteString - getServerIdBytes() { - java.lang.Object ref = serverId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serverId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRPCLB_ROUTE_TYPE_FIELD_NUMBER = 5; - private int grpclbRouteType_; - /** - *
-     * gRPCLB Path.
-     * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public int getGrpclbRouteTypeValue() { - return grpclbRouteType_; - } - /** - *
-     * gRPCLB Path.
-     * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public grpc.testing.Messages.GrpclbRouteType getGrpclbRouteType() { - grpc.testing.Messages.GrpclbRouteType result = grpc.testing.Messages.GrpclbRouteType.valueOf(grpclbRouteType_); - return result == null ? grpc.testing.Messages.GrpclbRouteType.UNRECOGNIZED : result; - } - - public static final int HOSTNAME_FIELD_NUMBER = 6; - private volatile java.lang.Object hostname_; - /** - *
-     * Server hostname.
-     * 
- * - * string hostname = 6; - */ - public java.lang.String getHostname() { - java.lang.Object ref = hostname_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostname_ = s; - return s; - } - } - /** - *
-     * Server hostname.
-     * 
- * - * string hostname = 6; - */ - public com.google.protobuf.ByteString - getHostnameBytes() { - java.lang.Object ref = hostname_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (payload_ != null) { - output.writeMessage(1, getPayload()); - } - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, username_); - } - if (!getOauthScopeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, oauthScope_); - } - if (!getServerIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serverId_); - } - if (grpclbRouteType_ != grpc.testing.Messages.GrpclbRouteType.GRPCLB_ROUTE_TYPE_UNKNOWN.getNumber()) { - output.writeEnum(5, grpclbRouteType_); - } - if (!getHostnameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, hostname_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (payload_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPayload()); - } - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, username_); - } - if (!getOauthScopeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, oauthScope_); - } - if (!getServerIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serverId_); - } - if (grpclbRouteType_ != grpc.testing.Messages.GrpclbRouteType.GRPCLB_ROUTE_TYPE_UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, grpclbRouteType_); - } - if (!getHostnameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, hostname_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.SimpleResponse)) { - return super.equals(obj); - } - grpc.testing.Messages.SimpleResponse other = (grpc.testing.Messages.SimpleResponse) obj; - - boolean result = true; - result = result && (hasPayload() == other.hasPayload()); - if (hasPayload()) { - result = result && getPayload() - .equals(other.getPayload()); - } - result = result && getUsername() - .equals(other.getUsername()); - result = result && getOauthScope() - .equals(other.getOauthScope()); - result = result && getServerId() - .equals(other.getServerId()); - result = result && grpclbRouteType_ == other.grpclbRouteType_; - result = result && getHostname() - .equals(other.getHostname()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPayload()) { - hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; - hash = (53 * hash) + getPayload().hashCode(); - } - hash = (37 * hash) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (37 * hash) + OAUTH_SCOPE_FIELD_NUMBER; - hash = (53 * hash) + getOauthScope().hashCode(); - hash = (37 * hash) + SERVER_ID_FIELD_NUMBER; - hash = (53 * hash) + getServerId().hashCode(); - hash = (37 * hash) + GRPCLB_ROUTE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + grpclbRouteType_; - hash = (37 * hash) + HOSTNAME_FIELD_NUMBER; - hash = (53 * hash) + getHostname().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.SimpleResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.SimpleResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.SimpleResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.SimpleResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.SimpleResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.SimpleResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.SimpleResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Unary response, as configured by the request.
-     * 
- * - * Protobuf type {@code grpc.testing.SimpleResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.SimpleResponse) - grpc.testing.Messages.SimpleResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.SimpleResponse.class, grpc.testing.Messages.SimpleResponse.Builder.class); - } - - // Construct using grpc.testing.Messages.SimpleResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - if (payloadBuilder_ == null) { - payload_ = null; - } else { - payload_ = null; - payloadBuilder_ = null; - } - username_ = ""; - - oauthScope_ = ""; - - serverId_ = ""; - - grpclbRouteType_ = 0; - - hostname_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_SimpleResponse_descriptor; - } - - public grpc.testing.Messages.SimpleResponse getDefaultInstanceForType() { - return grpc.testing.Messages.SimpleResponse.getDefaultInstance(); - } - - public grpc.testing.Messages.SimpleResponse build() { - grpc.testing.Messages.SimpleResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.SimpleResponse buildPartial() { - grpc.testing.Messages.SimpleResponse result = new grpc.testing.Messages.SimpleResponse(this); - if (payloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = payloadBuilder_.build(); - } - result.username_ = username_; - result.oauthScope_ = oauthScope_; - result.serverId_ = serverId_; - result.grpclbRouteType_ = grpclbRouteType_; - result.hostname_ = hostname_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.SimpleResponse) { - return mergeFrom((grpc.testing.Messages.SimpleResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.SimpleResponse other) { - if (other == grpc.testing.Messages.SimpleResponse.getDefaultInstance()) return this; - if (other.hasPayload()) { - mergePayload(other.getPayload()); - } - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - if (!other.getOauthScope().isEmpty()) { - oauthScope_ = other.oauthScope_; - onChanged(); - } - if (!other.getServerId().isEmpty()) { - serverId_ = other.serverId_; - onChanged(); - } - if (other.grpclbRouteType_ != 0) { - setGrpclbRouteTypeValue(other.getGrpclbRouteTypeValue()); - } - if (!other.getHostname().isEmpty()) { - hostname_ = other.hostname_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.SimpleResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.SimpleResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private grpc.testing.Messages.Payload payload_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> payloadBuilder_; - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public boolean hasPayload() { - return payloadBuilder_ != null || payload_ != null; - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload getPayload() { - if (payloadBuilder_ == null) { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } else { - return payloadBuilder_.getMessage(); - } - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder setPayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - payloadBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder setPayload( - grpc.testing.Messages.Payload.Builder builderForValue) { - if (payloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - payloadBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder mergePayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (payload_ != null) { - payload_ = - grpc.testing.Messages.Payload.newBuilder(payload_).mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - payloadBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder clearPayload() { - if (payloadBuilder_ == null) { - payload_ = null; - onChanged(); - } else { - payload_ = null; - payloadBuilder_ = null; - } - - return this; - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload.Builder getPayloadBuilder() { - - onChanged(); - return getPayloadFieldBuilder().getBuilder(); - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - if (payloadBuilder_ != null) { - return payloadBuilder_.getMessageOrBuilder(); - } else { - return payload_ == null ? - grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - } - /** - *
-       * Payload to increase message size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> - getPayloadFieldBuilder() { - if (payloadBuilder_ == null) { - payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder>( - getPayload(), - getParentForChildren(), - isClean()); - payload_ = null; - } - return payloadBuilder_; - } - - private java.lang.Object username_ = ""; - /** - *
-       * The user the request came from, for verifying authentication was
-       * successful when the client expected it.
-       * 
- * - * string username = 2; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The user the request came from, for verifying authentication was
-       * successful when the client expected it.
-       * 
- * - * string username = 2; - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The user the request came from, for verifying authentication was
-       * successful when the client expected it.
-       * 
- * - * string username = 2; - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - *
-       * The user the request came from, for verifying authentication was
-       * successful when the client expected it.
-       * 
- * - * string username = 2; - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - *
-       * The user the request came from, for verifying authentication was
-       * successful when the client expected it.
-       * 
- * - * string username = 2; - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - - private java.lang.Object oauthScope_ = ""; - /** - *
-       * OAuth scope.
-       * 
- * - * string oauth_scope = 3; - */ - public java.lang.String getOauthScope() { - java.lang.Object ref = oauthScope_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - oauthScope_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * OAuth scope.
-       * 
- * - * string oauth_scope = 3; - */ - public com.google.protobuf.ByteString - getOauthScopeBytes() { - java.lang.Object ref = oauthScope_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - oauthScope_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * OAuth scope.
-       * 
- * - * string oauth_scope = 3; - */ - public Builder setOauthScope( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - oauthScope_ = value; - onChanged(); - return this; - } - /** - *
-       * OAuth scope.
-       * 
- * - * string oauth_scope = 3; - */ - public Builder clearOauthScope() { - - oauthScope_ = getDefaultInstance().getOauthScope(); - onChanged(); - return this; - } - /** - *
-       * OAuth scope.
-       * 
- * - * string oauth_scope = 3; - */ - public Builder setOauthScopeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - oauthScope_ = value; - onChanged(); - return this; - } - - private java.lang.Object serverId_ = ""; - /** - *
-       * Server ID. This must be unique among different server instances,
-       * but the same across all RPC's made to a particular server instance.
-       * 
- * - * string server_id = 4; - */ - public java.lang.String getServerId() { - java.lang.Object ref = serverId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serverId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * Server ID. This must be unique among different server instances,
-       * but the same across all RPC's made to a particular server instance.
-       * 
- * - * string server_id = 4; - */ - public com.google.protobuf.ByteString - getServerIdBytes() { - java.lang.Object ref = serverId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serverId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * Server ID. This must be unique among different server instances,
-       * but the same across all RPC's made to a particular server instance.
-       * 
- * - * string server_id = 4; - */ - public Builder setServerId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serverId_ = value; - onChanged(); - return this; - } - /** - *
-       * Server ID. This must be unique among different server instances,
-       * but the same across all RPC's made to a particular server instance.
-       * 
- * - * string server_id = 4; - */ - public Builder clearServerId() { - - serverId_ = getDefaultInstance().getServerId(); - onChanged(); - return this; - } - /** - *
-       * Server ID. This must be unique among different server instances,
-       * but the same across all RPC's made to a particular server instance.
-       * 
- * - * string server_id = 4; - */ - public Builder setServerIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serverId_ = value; - onChanged(); - return this; - } - - private int grpclbRouteType_ = 0; - /** - *
-       * gRPCLB Path.
-       * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public int getGrpclbRouteTypeValue() { - return grpclbRouteType_; - } - /** - *
-       * gRPCLB Path.
-       * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public Builder setGrpclbRouteTypeValue(int value) { - grpclbRouteType_ = value; - onChanged(); - return this; - } - /** - *
-       * gRPCLB Path.
-       * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public grpc.testing.Messages.GrpclbRouteType getGrpclbRouteType() { - grpc.testing.Messages.GrpclbRouteType result = grpc.testing.Messages.GrpclbRouteType.valueOf(grpclbRouteType_); - return result == null ? grpc.testing.Messages.GrpclbRouteType.UNRECOGNIZED : result; - } - /** - *
-       * gRPCLB Path.
-       * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public Builder setGrpclbRouteType(grpc.testing.Messages.GrpclbRouteType value) { - if (value == null) { - throw new NullPointerException(); - } - - grpclbRouteType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-       * gRPCLB Path.
-       * 
- * - * .grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - public Builder clearGrpclbRouteType() { - - grpclbRouteType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object hostname_ = ""; - /** - *
-       * Server hostname.
-       * 
- * - * string hostname = 6; - */ - public java.lang.String getHostname() { - java.lang.Object ref = hostname_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostname_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * Server hostname.
-       * 
- * - * string hostname = 6; - */ - public com.google.protobuf.ByteString - getHostnameBytes() { - java.lang.Object ref = hostname_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * Server hostname.
-       * 
- * - * string hostname = 6; - */ - public Builder setHostname( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - hostname_ = value; - onChanged(); - return this; - } - /** - *
-       * Server hostname.
-       * 
- * - * string hostname = 6; - */ - public Builder clearHostname() { - - hostname_ = getDefaultInstance().getHostname(); - onChanged(); - return this; - } - /** - *
-       * Server hostname.
-       * 
- * - * string hostname = 6; - */ - public Builder setHostnameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - hostname_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.SimpleResponse) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.SimpleResponse) - private static final grpc.testing.Messages.SimpleResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.SimpleResponse(); - } - - public static grpc.testing.Messages.SimpleResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public SimpleResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SimpleResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.SimpleResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface StreamingInputCallRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.StreamingInputCallRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - boolean hasPayload(); - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - grpc.testing.Messages.Payload getPayload(); - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder(); - - /** - *
-     * Whether the server should expect this request to be compressed. This field
-     * is "nullable" in order to interoperate seamlessly with servers not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the request's compression status.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - boolean hasExpectCompressed(); - /** - *
-     * Whether the server should expect this request to be compressed. This field
-     * is "nullable" in order to interoperate seamlessly with servers not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the request's compression status.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - grpc.testing.Messages.BoolValue getExpectCompressed(); - /** - *
-     * Whether the server should expect this request to be compressed. This field
-     * is "nullable" in order to interoperate seamlessly with servers not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the request's compression status.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - grpc.testing.Messages.BoolValueOrBuilder getExpectCompressedOrBuilder(); - } - /** - *
-   * Client-streaming request.
-   * 
- * - * Protobuf type {@code grpc.testing.StreamingInputCallRequest} - */ - public static final class StreamingInputCallRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.StreamingInputCallRequest) - StreamingInputCallRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingInputCallRequest.newBuilder() to construct. - private StreamingInputCallRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingInputCallRequest() { - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingInputCallRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - grpc.testing.Messages.Payload.Builder subBuilder = null; - if (payload_ != null) { - subBuilder = payload_.toBuilder(); - } - payload_ = input.readMessage(grpc.testing.Messages.Payload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(payload_); - payload_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - grpc.testing.Messages.BoolValue.Builder subBuilder = null; - if (expectCompressed_ != null) { - subBuilder = expectCompressed_.toBuilder(); - } - expectCompressed_ = input.readMessage(grpc.testing.Messages.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expectCompressed_); - expectCompressed_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingInputCallRequest.class, grpc.testing.Messages.StreamingInputCallRequest.Builder.class); - } - - public static final int PAYLOAD_FIELD_NUMBER = 1; - private grpc.testing.Messages.Payload payload_; - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public boolean hasPayload() { - return payload_ != null; - } - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload getPayload() { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - return getPayload(); - } - - public static final int EXPECT_COMPRESSED_FIELD_NUMBER = 2; - private grpc.testing.Messages.BoolValue expectCompressed_; - /** - *
-     * Whether the server should expect this request to be compressed. This field
-     * is "nullable" in order to interoperate seamlessly with servers not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the request's compression status.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public boolean hasExpectCompressed() { - return expectCompressed_ != null; - } - /** - *
-     * Whether the server should expect this request to be compressed. This field
-     * is "nullable" in order to interoperate seamlessly with servers not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the request's compression status.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public grpc.testing.Messages.BoolValue getExpectCompressed() { - return expectCompressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : expectCompressed_; - } - /** - *
-     * Whether the server should expect this request to be compressed. This field
-     * is "nullable" in order to interoperate seamlessly with servers not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the request's compression status.
-     * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public grpc.testing.Messages.BoolValueOrBuilder getExpectCompressedOrBuilder() { - return getExpectCompressed(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (payload_ != null) { - output.writeMessage(1, getPayload()); - } - if (expectCompressed_ != null) { - output.writeMessage(2, getExpectCompressed()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (payload_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPayload()); - } - if (expectCompressed_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getExpectCompressed()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.StreamingInputCallRequest)) { - return super.equals(obj); - } - grpc.testing.Messages.StreamingInputCallRequest other = (grpc.testing.Messages.StreamingInputCallRequest) obj; - - boolean result = true; - result = result && (hasPayload() == other.hasPayload()); - if (hasPayload()) { - result = result && getPayload() - .equals(other.getPayload()); - } - result = result && (hasExpectCompressed() == other.hasExpectCompressed()); - if (hasExpectCompressed()) { - result = result && getExpectCompressed() - .equals(other.getExpectCompressed()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPayload()) { - hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; - hash = (53 * hash) + getPayload().hashCode(); - } - if (hasExpectCompressed()) { - hash = (37 * hash) + EXPECT_COMPRESSED_FIELD_NUMBER; - hash = (53 * hash) + getExpectCompressed().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingInputCallRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.StreamingInputCallRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Client-streaming request.
-     * 
- * - * Protobuf type {@code grpc.testing.StreamingInputCallRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.StreamingInputCallRequest) - grpc.testing.Messages.StreamingInputCallRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingInputCallRequest.class, grpc.testing.Messages.StreamingInputCallRequest.Builder.class); - } - - // Construct using grpc.testing.Messages.StreamingInputCallRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - if (payloadBuilder_ == null) { - payload_ = null; - } else { - payload_ = null; - payloadBuilder_ = null; - } - if (expectCompressedBuilder_ == null) { - expectCompressed_ = null; - } else { - expectCompressed_ = null; - expectCompressedBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallRequest_descriptor; - } - - public grpc.testing.Messages.StreamingInputCallRequest getDefaultInstanceForType() { - return grpc.testing.Messages.StreamingInputCallRequest.getDefaultInstance(); - } - - public grpc.testing.Messages.StreamingInputCallRequest build() { - grpc.testing.Messages.StreamingInputCallRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.StreamingInputCallRequest buildPartial() { - grpc.testing.Messages.StreamingInputCallRequest result = new grpc.testing.Messages.StreamingInputCallRequest(this); - if (payloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = payloadBuilder_.build(); - } - if (expectCompressedBuilder_ == null) { - result.expectCompressed_ = expectCompressed_; - } else { - result.expectCompressed_ = expectCompressedBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.StreamingInputCallRequest) { - return mergeFrom((grpc.testing.Messages.StreamingInputCallRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.StreamingInputCallRequest other) { - if (other == grpc.testing.Messages.StreamingInputCallRequest.getDefaultInstance()) return this; - if (other.hasPayload()) { - mergePayload(other.getPayload()); - } - if (other.hasExpectCompressed()) { - mergeExpectCompressed(other.getExpectCompressed()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.StreamingInputCallRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.StreamingInputCallRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private grpc.testing.Messages.Payload payload_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> payloadBuilder_; - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public boolean hasPayload() { - return payloadBuilder_ != null || payload_ != null; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload getPayload() { - if (payloadBuilder_ == null) { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } else { - return payloadBuilder_.getMessage(); - } - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder setPayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - payloadBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder setPayload( - grpc.testing.Messages.Payload.Builder builderForValue) { - if (payloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - payloadBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder mergePayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (payload_ != null) { - payload_ = - grpc.testing.Messages.Payload.newBuilder(payload_).mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - payloadBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder clearPayload() { - if (payloadBuilder_ == null) { - payload_ = null; - onChanged(); - } else { - payload_ = null; - payloadBuilder_ = null; - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload.Builder getPayloadBuilder() { - - onChanged(); - return getPayloadFieldBuilder().getBuilder(); - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - if (payloadBuilder_ != null) { - return payloadBuilder_.getMessageOrBuilder(); - } else { - return payload_ == null ? - grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> - getPayloadFieldBuilder() { - if (payloadBuilder_ == null) { - payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder>( - getPayload(), - getParentForChildren(), - isClean()); - payload_ = null; - } - return payloadBuilder_; - } - - private grpc.testing.Messages.BoolValue expectCompressed_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> expectCompressedBuilder_; - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public boolean hasExpectCompressed() { - return expectCompressedBuilder_ != null || expectCompressed_ != null; - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public grpc.testing.Messages.BoolValue getExpectCompressed() { - if (expectCompressedBuilder_ == null) { - return expectCompressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : expectCompressed_; - } else { - return expectCompressedBuilder_.getMessage(); - } - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public Builder setExpectCompressed(grpc.testing.Messages.BoolValue value) { - if (expectCompressedBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - expectCompressed_ = value; - onChanged(); - } else { - expectCompressedBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public Builder setExpectCompressed( - grpc.testing.Messages.BoolValue.Builder builderForValue) { - if (expectCompressedBuilder_ == null) { - expectCompressed_ = builderForValue.build(); - onChanged(); - } else { - expectCompressedBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public Builder mergeExpectCompressed(grpc.testing.Messages.BoolValue value) { - if (expectCompressedBuilder_ == null) { - if (expectCompressed_ != null) { - expectCompressed_ = - grpc.testing.Messages.BoolValue.newBuilder(expectCompressed_).mergeFrom(value).buildPartial(); - } else { - expectCompressed_ = value; - } - onChanged(); - } else { - expectCompressedBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public Builder clearExpectCompressed() { - if (expectCompressedBuilder_ == null) { - expectCompressed_ = null; - onChanged(); - } else { - expectCompressed_ = null; - expectCompressedBuilder_ = null; - } - - return this; - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public grpc.testing.Messages.BoolValue.Builder getExpectCompressedBuilder() { - - onChanged(); - return getExpectCompressedFieldBuilder().getBuilder(); - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - public grpc.testing.Messages.BoolValueOrBuilder getExpectCompressedOrBuilder() { - if (expectCompressedBuilder_ != null) { - return expectCompressedBuilder_.getMessageOrBuilder(); - } else { - return expectCompressed_ == null ? - grpc.testing.Messages.BoolValue.getDefaultInstance() : expectCompressed_; - } - } - /** - *
-       * Whether the server should expect this request to be compressed. This field
-       * is "nullable" in order to interoperate seamlessly with servers not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the request's compression status.
-       * 
- * - * .grpc.testing.BoolValue expect_compressed = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> - getExpectCompressedFieldBuilder() { - if (expectCompressedBuilder_ == null) { - expectCompressedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder>( - getExpectCompressed(), - getParentForChildren(), - isClean()); - expectCompressed_ = null; - } - return expectCompressedBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.StreamingInputCallRequest) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.StreamingInputCallRequest) - private static final grpc.testing.Messages.StreamingInputCallRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.StreamingInputCallRequest(); - } - - public static grpc.testing.Messages.StreamingInputCallRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public StreamingInputCallRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingInputCallRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.StreamingInputCallRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface StreamingInputCallResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.StreamingInputCallResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Aggregated size of payloads received from the client.
-     * 
- * - * int32 aggregated_payload_size = 1; - */ - int getAggregatedPayloadSize(); - } - /** - *
-   * Client-streaming response.
-   * 
- * - * Protobuf type {@code grpc.testing.StreamingInputCallResponse} - */ - public static final class StreamingInputCallResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.StreamingInputCallResponse) - StreamingInputCallResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingInputCallResponse.newBuilder() to construct. - private StreamingInputCallResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingInputCallResponse() { - aggregatedPayloadSize_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingInputCallResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - aggregatedPayloadSize_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingInputCallResponse.class, grpc.testing.Messages.StreamingInputCallResponse.Builder.class); - } - - public static final int AGGREGATED_PAYLOAD_SIZE_FIELD_NUMBER = 1; - private int aggregatedPayloadSize_; - /** - *
-     * Aggregated size of payloads received from the client.
-     * 
- * - * int32 aggregated_payload_size = 1; - */ - public int getAggregatedPayloadSize() { - return aggregatedPayloadSize_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (aggregatedPayloadSize_ != 0) { - output.writeInt32(1, aggregatedPayloadSize_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (aggregatedPayloadSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, aggregatedPayloadSize_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.StreamingInputCallResponse)) { - return super.equals(obj); - } - grpc.testing.Messages.StreamingInputCallResponse other = (grpc.testing.Messages.StreamingInputCallResponse) obj; - - boolean result = true; - result = result && (getAggregatedPayloadSize() - == other.getAggregatedPayloadSize()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + AGGREGATED_PAYLOAD_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getAggregatedPayloadSize(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingInputCallResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.StreamingInputCallResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Client-streaming response.
-     * 
- * - * Protobuf type {@code grpc.testing.StreamingInputCallResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.StreamingInputCallResponse) - grpc.testing.Messages.StreamingInputCallResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingInputCallResponse.class, grpc.testing.Messages.StreamingInputCallResponse.Builder.class); - } - - // Construct using grpc.testing.Messages.StreamingInputCallResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - aggregatedPayloadSize_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingInputCallResponse_descriptor; - } - - public grpc.testing.Messages.StreamingInputCallResponse getDefaultInstanceForType() { - return grpc.testing.Messages.StreamingInputCallResponse.getDefaultInstance(); - } - - public grpc.testing.Messages.StreamingInputCallResponse build() { - grpc.testing.Messages.StreamingInputCallResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.StreamingInputCallResponse buildPartial() { - grpc.testing.Messages.StreamingInputCallResponse result = new grpc.testing.Messages.StreamingInputCallResponse(this); - result.aggregatedPayloadSize_ = aggregatedPayloadSize_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.StreamingInputCallResponse) { - return mergeFrom((grpc.testing.Messages.StreamingInputCallResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.StreamingInputCallResponse other) { - if (other == grpc.testing.Messages.StreamingInputCallResponse.getDefaultInstance()) return this; - if (other.getAggregatedPayloadSize() != 0) { - setAggregatedPayloadSize(other.getAggregatedPayloadSize()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.StreamingInputCallResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.StreamingInputCallResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int aggregatedPayloadSize_ ; - /** - *
-       * Aggregated size of payloads received from the client.
-       * 
- * - * int32 aggregated_payload_size = 1; - */ - public int getAggregatedPayloadSize() { - return aggregatedPayloadSize_; - } - /** - *
-       * Aggregated size of payloads received from the client.
-       * 
- * - * int32 aggregated_payload_size = 1; - */ - public Builder setAggregatedPayloadSize(int value) { - - aggregatedPayloadSize_ = value; - onChanged(); - return this; - } - /** - *
-       * Aggregated size of payloads received from the client.
-       * 
- * - * int32 aggregated_payload_size = 1; - */ - public Builder clearAggregatedPayloadSize() { - - aggregatedPayloadSize_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.StreamingInputCallResponse) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.StreamingInputCallResponse) - private static final grpc.testing.Messages.StreamingInputCallResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.StreamingInputCallResponse(); - } - - public static grpc.testing.Messages.StreamingInputCallResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public StreamingInputCallResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingInputCallResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.StreamingInputCallResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ResponseParametersOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.ResponseParameters) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Desired payload sizes in responses from the server.
-     * 
- * - * int32 size = 1; - */ - int getSize(); - - /** - *
-     * Desired interval between consecutive responses in the response stream in
-     * microseconds.
-     * 
- * - * int32 interval_us = 2; - */ - int getIntervalUs(); - - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - boolean hasCompressed(); - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - grpc.testing.Messages.BoolValue getCompressed(); - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - grpc.testing.Messages.BoolValueOrBuilder getCompressedOrBuilder(); - } - /** - *
-   * Configuration for a particular response.
-   * 
- * - * Protobuf type {@code grpc.testing.ResponseParameters} - */ - public static final class ResponseParameters extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.ResponseParameters) - ResponseParametersOrBuilder { - private static final long serialVersionUID = 0L; - // Use ResponseParameters.newBuilder() to construct. - private ResponseParameters(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ResponseParameters() { - size_ = 0; - intervalUs_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ResponseParameters( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - size_ = input.readInt32(); - break; - } - case 16: { - - intervalUs_ = input.readInt32(); - break; - } - case 26: { - grpc.testing.Messages.BoolValue.Builder subBuilder = null; - if (compressed_ != null) { - subBuilder = compressed_.toBuilder(); - } - compressed_ = input.readMessage(grpc.testing.Messages.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(compressed_); - compressed_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_ResponseParameters_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_ResponseParameters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.ResponseParameters.class, grpc.testing.Messages.ResponseParameters.Builder.class); - } - - public static final int SIZE_FIELD_NUMBER = 1; - private int size_; - /** - *
-     * Desired payload sizes in responses from the server.
-     * 
- * - * int32 size = 1; - */ - public int getSize() { - return size_; - } - - public static final int INTERVAL_US_FIELD_NUMBER = 2; - private int intervalUs_; - /** - *
-     * Desired interval between consecutive responses in the response stream in
-     * microseconds.
-     * 
- * - * int32 interval_us = 2; - */ - public int getIntervalUs() { - return intervalUs_; - } - - public static final int COMPRESSED_FIELD_NUMBER = 3; - private grpc.testing.Messages.BoolValue compressed_; - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public boolean hasCompressed() { - return compressed_ != null; - } - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public grpc.testing.Messages.BoolValue getCompressed() { - return compressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : compressed_; - } - /** - *
-     * Whether to request the server to compress the response. This field is
-     * "nullable" in order to interoperate seamlessly with clients not able to
-     * implement the full compression tests by introspecting the call to verify
-     * the response's compression status.
-     * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public grpc.testing.Messages.BoolValueOrBuilder getCompressedOrBuilder() { - return getCompressed(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (size_ != 0) { - output.writeInt32(1, size_); - } - if (intervalUs_ != 0) { - output.writeInt32(2, intervalUs_); - } - if (compressed_ != null) { - output.writeMessage(3, getCompressed()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (size_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, size_); - } - if (intervalUs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, intervalUs_); - } - if (compressed_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getCompressed()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.ResponseParameters)) { - return super.equals(obj); - } - grpc.testing.Messages.ResponseParameters other = (grpc.testing.Messages.ResponseParameters) obj; - - boolean result = true; - result = result && (getSize() - == other.getSize()); - result = result && (getIntervalUs() - == other.getIntervalUs()); - result = result && (hasCompressed() == other.hasCompressed()); - if (hasCompressed()) { - result = result && getCompressed() - .equals(other.getCompressed()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + getSize(); - hash = (37 * hash) + INTERVAL_US_FIELD_NUMBER; - hash = (53 * hash) + getIntervalUs(); - if (hasCompressed()) { - hash = (37 * hash) + COMPRESSED_FIELD_NUMBER; - hash = (53 * hash) + getCompressed().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.ResponseParameters parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ResponseParameters parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ResponseParameters parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.ResponseParameters parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ResponseParameters parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ResponseParameters parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.ResponseParameters prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Configuration for a particular response.
-     * 
- * - * Protobuf type {@code grpc.testing.ResponseParameters} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.ResponseParameters) - grpc.testing.Messages.ResponseParametersOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_ResponseParameters_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_ResponseParameters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.ResponseParameters.class, grpc.testing.Messages.ResponseParameters.Builder.class); - } - - // Construct using grpc.testing.Messages.ResponseParameters.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - size_ = 0; - - intervalUs_ = 0; - - if (compressedBuilder_ == null) { - compressed_ = null; - } else { - compressed_ = null; - compressedBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_ResponseParameters_descriptor; - } - - public grpc.testing.Messages.ResponseParameters getDefaultInstanceForType() { - return grpc.testing.Messages.ResponseParameters.getDefaultInstance(); - } - - public grpc.testing.Messages.ResponseParameters build() { - grpc.testing.Messages.ResponseParameters result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.ResponseParameters buildPartial() { - grpc.testing.Messages.ResponseParameters result = new grpc.testing.Messages.ResponseParameters(this); - result.size_ = size_; - result.intervalUs_ = intervalUs_; - if (compressedBuilder_ == null) { - result.compressed_ = compressed_; - } else { - result.compressed_ = compressedBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.ResponseParameters) { - return mergeFrom((grpc.testing.Messages.ResponseParameters)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.ResponseParameters other) { - if (other == grpc.testing.Messages.ResponseParameters.getDefaultInstance()) return this; - if (other.getSize() != 0) { - setSize(other.getSize()); - } - if (other.getIntervalUs() != 0) { - setIntervalUs(other.getIntervalUs()); - } - if (other.hasCompressed()) { - mergeCompressed(other.getCompressed()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.ResponseParameters parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.ResponseParameters) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int size_ ; - /** - *
-       * Desired payload sizes in responses from the server.
-       * 
- * - * int32 size = 1; - */ - public int getSize() { - return size_; - } - /** - *
-       * Desired payload sizes in responses from the server.
-       * 
- * - * int32 size = 1; - */ - public Builder setSize(int value) { - - size_ = value; - onChanged(); - return this; - } - /** - *
-       * Desired payload sizes in responses from the server.
-       * 
- * - * int32 size = 1; - */ - public Builder clearSize() { - - size_ = 0; - onChanged(); - return this; - } - - private int intervalUs_ ; - /** - *
-       * Desired interval between consecutive responses in the response stream in
-       * microseconds.
-       * 
- * - * int32 interval_us = 2; - */ - public int getIntervalUs() { - return intervalUs_; - } - /** - *
-       * Desired interval between consecutive responses in the response stream in
-       * microseconds.
-       * 
- * - * int32 interval_us = 2; - */ - public Builder setIntervalUs(int value) { - - intervalUs_ = value; - onChanged(); - return this; - } - /** - *
-       * Desired interval between consecutive responses in the response stream in
-       * microseconds.
-       * 
- * - * int32 interval_us = 2; - */ - public Builder clearIntervalUs() { - - intervalUs_ = 0; - onChanged(); - return this; - } - - private grpc.testing.Messages.BoolValue compressed_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> compressedBuilder_; - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public boolean hasCompressed() { - return compressedBuilder_ != null || compressed_ != null; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public grpc.testing.Messages.BoolValue getCompressed() { - if (compressedBuilder_ == null) { - return compressed_ == null ? grpc.testing.Messages.BoolValue.getDefaultInstance() : compressed_; - } else { - return compressedBuilder_.getMessage(); - } - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public Builder setCompressed(grpc.testing.Messages.BoolValue value) { - if (compressedBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - compressed_ = value; - onChanged(); - } else { - compressedBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public Builder setCompressed( - grpc.testing.Messages.BoolValue.Builder builderForValue) { - if (compressedBuilder_ == null) { - compressed_ = builderForValue.build(); - onChanged(); - } else { - compressedBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public Builder mergeCompressed(grpc.testing.Messages.BoolValue value) { - if (compressedBuilder_ == null) { - if (compressed_ != null) { - compressed_ = - grpc.testing.Messages.BoolValue.newBuilder(compressed_).mergeFrom(value).buildPartial(); - } else { - compressed_ = value; - } - onChanged(); - } else { - compressedBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public Builder clearCompressed() { - if (compressedBuilder_ == null) { - compressed_ = null; - onChanged(); - } else { - compressed_ = null; - compressedBuilder_ = null; - } - - return this; - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public grpc.testing.Messages.BoolValue.Builder getCompressedBuilder() { - - onChanged(); - return getCompressedFieldBuilder().getBuilder(); - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - public grpc.testing.Messages.BoolValueOrBuilder getCompressedOrBuilder() { - if (compressedBuilder_ != null) { - return compressedBuilder_.getMessageOrBuilder(); - } else { - return compressed_ == null ? - grpc.testing.Messages.BoolValue.getDefaultInstance() : compressed_; - } - } - /** - *
-       * Whether to request the server to compress the response. This field is
-       * "nullable" in order to interoperate seamlessly with clients not able to
-       * implement the full compression tests by introspecting the call to verify
-       * the response's compression status.
-       * 
- * - * .grpc.testing.BoolValue compressed = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder> - getCompressedFieldBuilder() { - if (compressedBuilder_ == null) { - compressedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.BoolValue, grpc.testing.Messages.BoolValue.Builder, grpc.testing.Messages.BoolValueOrBuilder>( - getCompressed(), - getParentForChildren(), - isClean()); - compressed_ = null; - } - return compressedBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.ResponseParameters) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.ResponseParameters) - private static final grpc.testing.Messages.ResponseParameters DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.ResponseParameters(); - } - - public static grpc.testing.Messages.ResponseParameters getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ResponseParameters parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ResponseParameters(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.ResponseParameters getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface StreamingOutputCallRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.StreamingOutputCallRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, the payload from each response in the stream
-     * might be of different types. This is to simulate a mixed type of payload
-     * stream.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - int getResponseTypeValue(); - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, the payload from each response in the stream
-     * might be of different types. This is to simulate a mixed type of payload
-     * stream.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - grpc.testing.Messages.PayloadType getResponseType(); - - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - java.util.List - getResponseParametersList(); - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - grpc.testing.Messages.ResponseParameters getResponseParameters(int index); - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - int getResponseParametersCount(); - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - java.util.List - getResponseParametersOrBuilderList(); - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - grpc.testing.Messages.ResponseParametersOrBuilder getResponseParametersOrBuilder( - int index); - - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - boolean hasPayload(); - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - grpc.testing.Messages.Payload getPayload(); - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder(); - - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - boolean hasResponseStatus(); - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - grpc.testing.Messages.EchoStatus getResponseStatus(); - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - grpc.testing.Messages.EchoStatusOrBuilder getResponseStatusOrBuilder(); - } - /** - *
-   * Server-streaming request.
-   * 
- * - * Protobuf type {@code grpc.testing.StreamingOutputCallRequest} - */ - public static final class StreamingOutputCallRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.StreamingOutputCallRequest) - StreamingOutputCallRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingOutputCallRequest.newBuilder() to construct. - private StreamingOutputCallRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingOutputCallRequest() { - responseType_ = 0; - responseParameters_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingOutputCallRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - - responseType_ = rawValue; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - responseParameters_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - responseParameters_.add( - input.readMessage(grpc.testing.Messages.ResponseParameters.parser(), extensionRegistry)); - break; - } - case 26: { - grpc.testing.Messages.Payload.Builder subBuilder = null; - if (payload_ != null) { - subBuilder = payload_.toBuilder(); - } - payload_ = input.readMessage(grpc.testing.Messages.Payload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(payload_); - payload_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - grpc.testing.Messages.EchoStatus.Builder subBuilder = null; - if (responseStatus_ != null) { - subBuilder = responseStatus_.toBuilder(); - } - responseStatus_ = input.readMessage(grpc.testing.Messages.EchoStatus.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(responseStatus_); - responseStatus_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - responseParameters_ = java.util.Collections.unmodifiableList(responseParameters_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingOutputCallRequest.class, grpc.testing.Messages.StreamingOutputCallRequest.Builder.class); - } - - private int bitField0_; - public static final int RESPONSE_TYPE_FIELD_NUMBER = 1; - private int responseType_; - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, the payload from each response in the stream
-     * might be of different types. This is to simulate a mixed type of payload
-     * stream.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public int getResponseTypeValue() { - return responseType_; - } - /** - *
-     * Desired payload type in the response from the server.
-     * If response_type is RANDOM, the payload from each response in the stream
-     * might be of different types. This is to simulate a mixed type of payload
-     * stream.
-     * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public grpc.testing.Messages.PayloadType getResponseType() { - grpc.testing.Messages.PayloadType result = grpc.testing.Messages.PayloadType.valueOf(responseType_); - return result == null ? grpc.testing.Messages.PayloadType.UNRECOGNIZED : result; - } - - public static final int RESPONSE_PARAMETERS_FIELD_NUMBER = 2; - private java.util.List responseParameters_; - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public java.util.List getResponseParametersList() { - return responseParameters_; - } - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public java.util.List - getResponseParametersOrBuilderList() { - return responseParameters_; - } - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public int getResponseParametersCount() { - return responseParameters_.size(); - } - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParameters getResponseParameters(int index) { - return responseParameters_.get(index); - } - /** - *
-     * Configuration for each expected response message.
-     * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParametersOrBuilder getResponseParametersOrBuilder( - int index) { - return responseParameters_.get(index); - } - - public static final int PAYLOAD_FIELD_NUMBER = 3; - private grpc.testing.Messages.Payload payload_; - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - public boolean hasPayload() { - return payload_ != null; - } - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.Payload getPayload() { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - /** - *
-     * Optional input payload sent along with the request.
-     * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - return getPayload(); - } - - public static final int RESPONSE_STATUS_FIELD_NUMBER = 7; - private grpc.testing.Messages.EchoStatus responseStatus_; - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public boolean hasResponseStatus() { - return responseStatus_ != null; - } - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatus getResponseStatus() { - return responseStatus_ == null ? grpc.testing.Messages.EchoStatus.getDefaultInstance() : responseStatus_; - } - /** - *
-     * Whether server should return a given status
-     * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatusOrBuilder getResponseStatusOrBuilder() { - return getResponseStatus(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (responseType_ != grpc.testing.Messages.PayloadType.COMPRESSABLE.getNumber()) { - output.writeEnum(1, responseType_); - } - for (int i = 0; i < responseParameters_.size(); i++) { - output.writeMessage(2, responseParameters_.get(i)); - } - if (payload_ != null) { - output.writeMessage(3, getPayload()); - } - if (responseStatus_ != null) { - output.writeMessage(7, getResponseStatus()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (responseType_ != grpc.testing.Messages.PayloadType.COMPRESSABLE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, responseType_); - } - for (int i = 0; i < responseParameters_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, responseParameters_.get(i)); - } - if (payload_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPayload()); - } - if (responseStatus_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getResponseStatus()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.StreamingOutputCallRequest)) { - return super.equals(obj); - } - grpc.testing.Messages.StreamingOutputCallRequest other = (grpc.testing.Messages.StreamingOutputCallRequest) obj; - - boolean result = true; - result = result && responseType_ == other.responseType_; - result = result && getResponseParametersList() - .equals(other.getResponseParametersList()); - result = result && (hasPayload() == other.hasPayload()); - if (hasPayload()) { - result = result && getPayload() - .equals(other.getPayload()); - } - result = result && (hasResponseStatus() == other.hasResponseStatus()); - if (hasResponseStatus()) { - result = result && getResponseStatus() - .equals(other.getResponseStatus()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RESPONSE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + responseType_; - if (getResponseParametersCount() > 0) { - hash = (37 * hash) + RESPONSE_PARAMETERS_FIELD_NUMBER; - hash = (53 * hash) + getResponseParametersList().hashCode(); - } - if (hasPayload()) { - hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; - hash = (53 * hash) + getPayload().hashCode(); - } - if (hasResponseStatus()) { - hash = (37 * hash) + RESPONSE_STATUS_FIELD_NUMBER; - hash = (53 * hash) + getResponseStatus().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingOutputCallRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.StreamingOutputCallRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Server-streaming request.
-     * 
- * - * Protobuf type {@code grpc.testing.StreamingOutputCallRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.StreamingOutputCallRequest) - grpc.testing.Messages.StreamingOutputCallRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingOutputCallRequest.class, grpc.testing.Messages.StreamingOutputCallRequest.Builder.class); - } - - // Construct using grpc.testing.Messages.StreamingOutputCallRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResponseParametersFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - responseType_ = 0; - - if (responseParametersBuilder_ == null) { - responseParameters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - responseParametersBuilder_.clear(); - } - if (payloadBuilder_ == null) { - payload_ = null; - } else { - payload_ = null; - payloadBuilder_ = null; - } - if (responseStatusBuilder_ == null) { - responseStatus_ = null; - } else { - responseStatus_ = null; - responseStatusBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallRequest_descriptor; - } - - public grpc.testing.Messages.StreamingOutputCallRequest getDefaultInstanceForType() { - return grpc.testing.Messages.StreamingOutputCallRequest.getDefaultInstance(); - } - - public grpc.testing.Messages.StreamingOutputCallRequest build() { - grpc.testing.Messages.StreamingOutputCallRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.StreamingOutputCallRequest buildPartial() { - grpc.testing.Messages.StreamingOutputCallRequest result = new grpc.testing.Messages.StreamingOutputCallRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.responseType_ = responseType_; - if (responseParametersBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - responseParameters_ = java.util.Collections.unmodifiableList(responseParameters_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.responseParameters_ = responseParameters_; - } else { - result.responseParameters_ = responseParametersBuilder_.build(); - } - if (payloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = payloadBuilder_.build(); - } - if (responseStatusBuilder_ == null) { - result.responseStatus_ = responseStatus_; - } else { - result.responseStatus_ = responseStatusBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.StreamingOutputCallRequest) { - return mergeFrom((grpc.testing.Messages.StreamingOutputCallRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.StreamingOutputCallRequest other) { - if (other == grpc.testing.Messages.StreamingOutputCallRequest.getDefaultInstance()) return this; - if (other.responseType_ != 0) { - setResponseTypeValue(other.getResponseTypeValue()); - } - if (responseParametersBuilder_ == null) { - if (!other.responseParameters_.isEmpty()) { - if (responseParameters_.isEmpty()) { - responseParameters_ = other.responseParameters_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureResponseParametersIsMutable(); - responseParameters_.addAll(other.responseParameters_); - } - onChanged(); - } - } else { - if (!other.responseParameters_.isEmpty()) { - if (responseParametersBuilder_.isEmpty()) { - responseParametersBuilder_.dispose(); - responseParametersBuilder_ = null; - responseParameters_ = other.responseParameters_; - bitField0_ = (bitField0_ & ~0x00000002); - responseParametersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResponseParametersFieldBuilder() : null; - } else { - responseParametersBuilder_.addAllMessages(other.responseParameters_); - } - } - } - if (other.hasPayload()) { - mergePayload(other.getPayload()); - } - if (other.hasResponseStatus()) { - mergeResponseStatus(other.getResponseStatus()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.StreamingOutputCallRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.StreamingOutputCallRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int responseType_ = 0; - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, the payload from each response in the stream
-       * might be of different types. This is to simulate a mixed type of payload
-       * stream.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public int getResponseTypeValue() { - return responseType_; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, the payload from each response in the stream
-       * might be of different types. This is to simulate a mixed type of payload
-       * stream.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public Builder setResponseTypeValue(int value) { - responseType_ = value; - onChanged(); - return this; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, the payload from each response in the stream
-       * might be of different types. This is to simulate a mixed type of payload
-       * stream.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public grpc.testing.Messages.PayloadType getResponseType() { - grpc.testing.Messages.PayloadType result = grpc.testing.Messages.PayloadType.valueOf(responseType_); - return result == null ? grpc.testing.Messages.PayloadType.UNRECOGNIZED : result; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, the payload from each response in the stream
-       * might be of different types. This is to simulate a mixed type of payload
-       * stream.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public Builder setResponseType(grpc.testing.Messages.PayloadType value) { - if (value == null) { - throw new NullPointerException(); - } - - responseType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-       * Desired payload type in the response from the server.
-       * If response_type is RANDOM, the payload from each response in the stream
-       * might be of different types. This is to simulate a mixed type of payload
-       * stream.
-       * 
- * - * .grpc.testing.PayloadType response_type = 1; - */ - public Builder clearResponseType() { - - responseType_ = 0; - onChanged(); - return this; - } - - private java.util.List responseParameters_ = - java.util.Collections.emptyList(); - private void ensureResponseParametersIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - responseParameters_ = new java.util.ArrayList(responseParameters_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - grpc.testing.Messages.ResponseParameters, grpc.testing.Messages.ResponseParameters.Builder, grpc.testing.Messages.ResponseParametersOrBuilder> responseParametersBuilder_; - - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public java.util.List getResponseParametersList() { - if (responseParametersBuilder_ == null) { - return java.util.Collections.unmodifiableList(responseParameters_); - } else { - return responseParametersBuilder_.getMessageList(); - } - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public int getResponseParametersCount() { - if (responseParametersBuilder_ == null) { - return responseParameters_.size(); - } else { - return responseParametersBuilder_.getCount(); - } - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParameters getResponseParameters(int index) { - if (responseParametersBuilder_ == null) { - return responseParameters_.get(index); - } else { - return responseParametersBuilder_.getMessage(index); - } - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder setResponseParameters( - int index, grpc.testing.Messages.ResponseParameters value) { - if (responseParametersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseParametersIsMutable(); - responseParameters_.set(index, value); - onChanged(); - } else { - responseParametersBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder setResponseParameters( - int index, grpc.testing.Messages.ResponseParameters.Builder builderForValue) { - if (responseParametersBuilder_ == null) { - ensureResponseParametersIsMutable(); - responseParameters_.set(index, builderForValue.build()); - onChanged(); - } else { - responseParametersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder addResponseParameters(grpc.testing.Messages.ResponseParameters value) { - if (responseParametersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseParametersIsMutable(); - responseParameters_.add(value); - onChanged(); - } else { - responseParametersBuilder_.addMessage(value); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder addResponseParameters( - int index, grpc.testing.Messages.ResponseParameters value) { - if (responseParametersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseParametersIsMutable(); - responseParameters_.add(index, value); - onChanged(); - } else { - responseParametersBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder addResponseParameters( - grpc.testing.Messages.ResponseParameters.Builder builderForValue) { - if (responseParametersBuilder_ == null) { - ensureResponseParametersIsMutable(); - responseParameters_.add(builderForValue.build()); - onChanged(); - } else { - responseParametersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder addResponseParameters( - int index, grpc.testing.Messages.ResponseParameters.Builder builderForValue) { - if (responseParametersBuilder_ == null) { - ensureResponseParametersIsMutable(); - responseParameters_.add(index, builderForValue.build()); - onChanged(); - } else { - responseParametersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder addAllResponseParameters( - java.lang.Iterable values) { - if (responseParametersBuilder_ == null) { - ensureResponseParametersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, responseParameters_); - onChanged(); - } else { - responseParametersBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder clearResponseParameters() { - if (responseParametersBuilder_ == null) { - responseParameters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - responseParametersBuilder_.clear(); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public Builder removeResponseParameters(int index) { - if (responseParametersBuilder_ == null) { - ensureResponseParametersIsMutable(); - responseParameters_.remove(index); - onChanged(); - } else { - responseParametersBuilder_.remove(index); - } - return this; - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParameters.Builder getResponseParametersBuilder( - int index) { - return getResponseParametersFieldBuilder().getBuilder(index); - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParametersOrBuilder getResponseParametersOrBuilder( - int index) { - if (responseParametersBuilder_ == null) { - return responseParameters_.get(index); } else { - return responseParametersBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public java.util.List - getResponseParametersOrBuilderList() { - if (responseParametersBuilder_ != null) { - return responseParametersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(responseParameters_); - } - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParameters.Builder addResponseParametersBuilder() { - return getResponseParametersFieldBuilder().addBuilder( - grpc.testing.Messages.ResponseParameters.getDefaultInstance()); - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public grpc.testing.Messages.ResponseParameters.Builder addResponseParametersBuilder( - int index) { - return getResponseParametersFieldBuilder().addBuilder( - index, grpc.testing.Messages.ResponseParameters.getDefaultInstance()); - } - /** - *
-       * Configuration for each expected response message.
-       * 
- * - * repeated .grpc.testing.ResponseParameters response_parameters = 2; - */ - public java.util.List - getResponseParametersBuilderList() { - return getResponseParametersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - grpc.testing.Messages.ResponseParameters, grpc.testing.Messages.ResponseParameters.Builder, grpc.testing.Messages.ResponseParametersOrBuilder> - getResponseParametersFieldBuilder() { - if (responseParametersBuilder_ == null) { - responseParametersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - grpc.testing.Messages.ResponseParameters, grpc.testing.Messages.ResponseParameters.Builder, grpc.testing.Messages.ResponseParametersOrBuilder>( - responseParameters_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - responseParameters_ = null; - } - return responseParametersBuilder_; - } - - private grpc.testing.Messages.Payload payload_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> payloadBuilder_; - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public boolean hasPayload() { - return payloadBuilder_ != null || payload_ != null; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.Payload getPayload() { - if (payloadBuilder_ == null) { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } else { - return payloadBuilder_.getMessage(); - } - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder setPayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - payloadBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder setPayload( - grpc.testing.Messages.Payload.Builder builderForValue) { - if (payloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - payloadBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder mergePayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (payload_ != null) { - payload_ = - grpc.testing.Messages.Payload.newBuilder(payload_).mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - payloadBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public Builder clearPayload() { - if (payloadBuilder_ == null) { - payload_ = null; - onChanged(); - } else { - payload_ = null; - payloadBuilder_ = null; - } - - return this; - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.Payload.Builder getPayloadBuilder() { - - onChanged(); - return getPayloadFieldBuilder().getBuilder(); - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - if (payloadBuilder_ != null) { - return payloadBuilder_.getMessageOrBuilder(); - } else { - return payload_ == null ? - grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - } - /** - *
-       * Optional input payload sent along with the request.
-       * 
- * - * .grpc.testing.Payload payload = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> - getPayloadFieldBuilder() { - if (payloadBuilder_ == null) { - payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder>( - getPayload(), - getParentForChildren(), - isClean()); - payload_ = null; - } - return payloadBuilder_; - } - - private grpc.testing.Messages.EchoStatus responseStatus_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.EchoStatus, grpc.testing.Messages.EchoStatus.Builder, grpc.testing.Messages.EchoStatusOrBuilder> responseStatusBuilder_; - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public boolean hasResponseStatus() { - return responseStatusBuilder_ != null || responseStatus_ != null; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatus getResponseStatus() { - if (responseStatusBuilder_ == null) { - return responseStatus_ == null ? grpc.testing.Messages.EchoStatus.getDefaultInstance() : responseStatus_; - } else { - return responseStatusBuilder_.getMessage(); - } - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder setResponseStatus(grpc.testing.Messages.EchoStatus value) { - if (responseStatusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - responseStatus_ = value; - onChanged(); - } else { - responseStatusBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder setResponseStatus( - grpc.testing.Messages.EchoStatus.Builder builderForValue) { - if (responseStatusBuilder_ == null) { - responseStatus_ = builderForValue.build(); - onChanged(); - } else { - responseStatusBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder mergeResponseStatus(grpc.testing.Messages.EchoStatus value) { - if (responseStatusBuilder_ == null) { - if (responseStatus_ != null) { - responseStatus_ = - grpc.testing.Messages.EchoStatus.newBuilder(responseStatus_).mergeFrom(value).buildPartial(); - } else { - responseStatus_ = value; - } - onChanged(); - } else { - responseStatusBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public Builder clearResponseStatus() { - if (responseStatusBuilder_ == null) { - responseStatus_ = null; - onChanged(); - } else { - responseStatus_ = null; - responseStatusBuilder_ = null; - } - - return this; - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatus.Builder getResponseStatusBuilder() { - - onChanged(); - return getResponseStatusFieldBuilder().getBuilder(); - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - public grpc.testing.Messages.EchoStatusOrBuilder getResponseStatusOrBuilder() { - if (responseStatusBuilder_ != null) { - return responseStatusBuilder_.getMessageOrBuilder(); - } else { - return responseStatus_ == null ? - grpc.testing.Messages.EchoStatus.getDefaultInstance() : responseStatus_; - } - } - /** - *
-       * Whether server should return a given status
-       * 
- * - * .grpc.testing.EchoStatus response_status = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.EchoStatus, grpc.testing.Messages.EchoStatus.Builder, grpc.testing.Messages.EchoStatusOrBuilder> - getResponseStatusFieldBuilder() { - if (responseStatusBuilder_ == null) { - responseStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.EchoStatus, grpc.testing.Messages.EchoStatus.Builder, grpc.testing.Messages.EchoStatusOrBuilder>( - getResponseStatus(), - getParentForChildren(), - isClean()); - responseStatus_ = null; - } - return responseStatusBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.StreamingOutputCallRequest) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.StreamingOutputCallRequest) - private static final grpc.testing.Messages.StreamingOutputCallRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.StreamingOutputCallRequest(); - } - - public static grpc.testing.Messages.StreamingOutputCallRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public StreamingOutputCallRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingOutputCallRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.StreamingOutputCallRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface StreamingOutputCallResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.StreamingOutputCallResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Payload to increase response size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - boolean hasPayload(); - /** - *
-     * Payload to increase response size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - grpc.testing.Messages.Payload getPayload(); - /** - *
-     * Payload to increase response size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder(); - } - /** - *
-   * Server-streaming response, as configured by the request and parameters.
-   * 
- * - * Protobuf type {@code grpc.testing.StreamingOutputCallResponse} - */ - public static final class StreamingOutputCallResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.StreamingOutputCallResponse) - StreamingOutputCallResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingOutputCallResponse.newBuilder() to construct. - private StreamingOutputCallResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingOutputCallResponse() { - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingOutputCallResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - grpc.testing.Messages.Payload.Builder subBuilder = null; - if (payload_ != null) { - subBuilder = payload_.toBuilder(); - } - payload_ = input.readMessage(grpc.testing.Messages.Payload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(payload_); - payload_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingOutputCallResponse.class, grpc.testing.Messages.StreamingOutputCallResponse.Builder.class); - } - - public static final int PAYLOAD_FIELD_NUMBER = 1; - private grpc.testing.Messages.Payload payload_; - /** - *
-     * Payload to increase response size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public boolean hasPayload() { - return payload_ != null; - } - /** - *
-     * Payload to increase response size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload getPayload() { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - /** - *
-     * Payload to increase response size.
-     * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - return getPayload(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (payload_ != null) { - output.writeMessage(1, getPayload()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (payload_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPayload()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.StreamingOutputCallResponse)) { - return super.equals(obj); - } - grpc.testing.Messages.StreamingOutputCallResponse other = (grpc.testing.Messages.StreamingOutputCallResponse) obj; - - boolean result = true; - result = result && (hasPayload() == other.hasPayload()); - if (hasPayload()) { - result = result && getPayload() - .equals(other.getPayload()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPayload()) { - hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; - hash = (53 * hash) + getPayload().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.StreamingOutputCallResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.StreamingOutputCallResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Server-streaming response, as configured by the request and parameters.
-     * 
- * - * Protobuf type {@code grpc.testing.StreamingOutputCallResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.StreamingOutputCallResponse) - grpc.testing.Messages.StreamingOutputCallResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.StreamingOutputCallResponse.class, grpc.testing.Messages.StreamingOutputCallResponse.Builder.class); - } - - // Construct using grpc.testing.Messages.StreamingOutputCallResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - if (payloadBuilder_ == null) { - payload_ = null; - } else { - payload_ = null; - payloadBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_StreamingOutputCallResponse_descriptor; - } - - public grpc.testing.Messages.StreamingOutputCallResponse getDefaultInstanceForType() { - return grpc.testing.Messages.StreamingOutputCallResponse.getDefaultInstance(); - } - - public grpc.testing.Messages.StreamingOutputCallResponse build() { - grpc.testing.Messages.StreamingOutputCallResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.StreamingOutputCallResponse buildPartial() { - grpc.testing.Messages.StreamingOutputCallResponse result = new grpc.testing.Messages.StreamingOutputCallResponse(this); - if (payloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = payloadBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.StreamingOutputCallResponse) { - return mergeFrom((grpc.testing.Messages.StreamingOutputCallResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.StreamingOutputCallResponse other) { - if (other == grpc.testing.Messages.StreamingOutputCallResponse.getDefaultInstance()) return this; - if (other.hasPayload()) { - mergePayload(other.getPayload()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.StreamingOutputCallResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.StreamingOutputCallResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private grpc.testing.Messages.Payload payload_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> payloadBuilder_; - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public boolean hasPayload() { - return payloadBuilder_ != null || payload_ != null; - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload getPayload() { - if (payloadBuilder_ == null) { - return payload_ == null ? grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } else { - return payloadBuilder_.getMessage(); - } - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder setPayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - payloadBuilder_.setMessage(value); - } - - return this; - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder setPayload( - grpc.testing.Messages.Payload.Builder builderForValue) { - if (payloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - payloadBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder mergePayload(grpc.testing.Messages.Payload value) { - if (payloadBuilder_ == null) { - if (payload_ != null) { - payload_ = - grpc.testing.Messages.Payload.newBuilder(payload_).mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - payloadBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public Builder clearPayload() { - if (payloadBuilder_ == null) { - payload_ = null; - onChanged(); - } else { - payload_ = null; - payloadBuilder_ = null; - } - - return this; - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.Payload.Builder getPayloadBuilder() { - - onChanged(); - return getPayloadFieldBuilder().getBuilder(); - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - public grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder() { - if (payloadBuilder_ != null) { - return payloadBuilder_.getMessageOrBuilder(); - } else { - return payload_ == null ? - grpc.testing.Messages.Payload.getDefaultInstance() : payload_; - } - } - /** - *
-       * Payload to increase response size.
-       * 
- * - * .grpc.testing.Payload payload = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder> - getPayloadFieldBuilder() { - if (payloadBuilder_ == null) { - payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - grpc.testing.Messages.Payload, grpc.testing.Messages.Payload.Builder, grpc.testing.Messages.PayloadOrBuilder>( - getPayload(), - getParentForChildren(), - isClean()); - payload_ = null; - } - return payloadBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.StreamingOutputCallResponse) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.StreamingOutputCallResponse) - private static final grpc.testing.Messages.StreamingOutputCallResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.StreamingOutputCallResponse(); - } - - public static grpc.testing.Messages.StreamingOutputCallResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public StreamingOutputCallResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingOutputCallResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.StreamingOutputCallResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ReconnectParamsOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.ReconnectParams) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 max_reconnect_backoff_ms = 1; - */ - int getMaxReconnectBackoffMs(); - } - /** - *
-   * For reconnect interop test only.
-   * Client tells server what reconnection parameters it used.
-   * 
- * - * Protobuf type {@code grpc.testing.ReconnectParams} - */ - public static final class ReconnectParams extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.ReconnectParams) - ReconnectParamsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ReconnectParams.newBuilder() to construct. - private ReconnectParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ReconnectParams() { - maxReconnectBackoffMs_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ReconnectParams( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - maxReconnectBackoffMs_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectParams_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.ReconnectParams.class, grpc.testing.Messages.ReconnectParams.Builder.class); - } - - public static final int MAX_RECONNECT_BACKOFF_MS_FIELD_NUMBER = 1; - private int maxReconnectBackoffMs_; - /** - * int32 max_reconnect_backoff_ms = 1; - */ - public int getMaxReconnectBackoffMs() { - return maxReconnectBackoffMs_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (maxReconnectBackoffMs_ != 0) { - output.writeInt32(1, maxReconnectBackoffMs_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (maxReconnectBackoffMs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, maxReconnectBackoffMs_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.ReconnectParams)) { - return super.equals(obj); - } - grpc.testing.Messages.ReconnectParams other = (grpc.testing.Messages.ReconnectParams) obj; - - boolean result = true; - result = result && (getMaxReconnectBackoffMs() - == other.getMaxReconnectBackoffMs()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MAX_RECONNECT_BACKOFF_MS_FIELD_NUMBER; - hash = (53 * hash) + getMaxReconnectBackoffMs(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.ReconnectParams parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectParams parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectParams parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectParams parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ReconnectParams parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ReconnectParams parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.ReconnectParams prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * For reconnect interop test only.
-     * Client tells server what reconnection parameters it used.
-     * 
- * - * Protobuf type {@code grpc.testing.ReconnectParams} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.ReconnectParams) - grpc.testing.Messages.ReconnectParamsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectParams_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.ReconnectParams.class, grpc.testing.Messages.ReconnectParams.Builder.class); - } - - // Construct using grpc.testing.Messages.ReconnectParams.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - maxReconnectBackoffMs_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectParams_descriptor; - } - - public grpc.testing.Messages.ReconnectParams getDefaultInstanceForType() { - return grpc.testing.Messages.ReconnectParams.getDefaultInstance(); - } - - public grpc.testing.Messages.ReconnectParams build() { - grpc.testing.Messages.ReconnectParams result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.ReconnectParams buildPartial() { - grpc.testing.Messages.ReconnectParams result = new grpc.testing.Messages.ReconnectParams(this); - result.maxReconnectBackoffMs_ = maxReconnectBackoffMs_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.ReconnectParams) { - return mergeFrom((grpc.testing.Messages.ReconnectParams)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.ReconnectParams other) { - if (other == grpc.testing.Messages.ReconnectParams.getDefaultInstance()) return this; - if (other.getMaxReconnectBackoffMs() != 0) { - setMaxReconnectBackoffMs(other.getMaxReconnectBackoffMs()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.ReconnectParams parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.ReconnectParams) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int maxReconnectBackoffMs_ ; - /** - * int32 max_reconnect_backoff_ms = 1; - */ - public int getMaxReconnectBackoffMs() { - return maxReconnectBackoffMs_; - } - /** - * int32 max_reconnect_backoff_ms = 1; - */ - public Builder setMaxReconnectBackoffMs(int value) { - - maxReconnectBackoffMs_ = value; - onChanged(); - return this; - } - /** - * int32 max_reconnect_backoff_ms = 1; - */ - public Builder clearMaxReconnectBackoffMs() { - - maxReconnectBackoffMs_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.ReconnectParams) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.ReconnectParams) - private static final grpc.testing.Messages.ReconnectParams DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.ReconnectParams(); - } - - public static grpc.testing.Messages.ReconnectParams getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ReconnectParams parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReconnectParams(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.ReconnectParams getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ReconnectInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.ReconnectInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * bool passed = 1; - */ - boolean getPassed(); - - /** - * repeated int32 backoff_ms = 2; - */ - java.util.List getBackoffMsList(); - /** - * repeated int32 backoff_ms = 2; - */ - int getBackoffMsCount(); - /** - * repeated int32 backoff_ms = 2; - */ - int getBackoffMs(int index); - } - /** - *
-   * For reconnect interop test only.
-   * Server tells client whether its reconnects are following the spec and the
-   * reconnect backoffs it saw.
-   * 
- * - * Protobuf type {@code grpc.testing.ReconnectInfo} - */ - public static final class ReconnectInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.ReconnectInfo) - ReconnectInfoOrBuilder { - private static final long serialVersionUID = 0L; - // Use ReconnectInfo.newBuilder() to construct. - private ReconnectInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ReconnectInfo() { - passed_ = false; - backoffMs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ReconnectInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - passed_ = input.readBool(); - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - backoffMs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - backoffMs_.add(input.readInt32()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { - backoffMs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - backoffMs_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - backoffMs_ = java.util.Collections.unmodifiableList(backoffMs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectInfo_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.ReconnectInfo.class, grpc.testing.Messages.ReconnectInfo.Builder.class); - } - - private int bitField0_; - public static final int PASSED_FIELD_NUMBER = 1; - private boolean passed_; - /** - * bool passed = 1; - */ - public boolean getPassed() { - return passed_; - } - - public static final int BACKOFF_MS_FIELD_NUMBER = 2; - private java.util.List backoffMs_; - /** - * repeated int32 backoff_ms = 2; - */ - public java.util.List - getBackoffMsList() { - return backoffMs_; - } - /** - * repeated int32 backoff_ms = 2; - */ - public int getBackoffMsCount() { - return backoffMs_.size(); - } - /** - * repeated int32 backoff_ms = 2; - */ - public int getBackoffMs(int index) { - return backoffMs_.get(index); - } - private int backoffMsMemoizedSerializedSize = -1; - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (passed_ != false) { - output.writeBool(1, passed_); - } - if (getBackoffMsList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(backoffMsMemoizedSerializedSize); - } - for (int i = 0; i < backoffMs_.size(); i++) { - output.writeInt32NoTag(backoffMs_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (passed_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, passed_); - } - { - int dataSize = 0; - for (int i = 0; i < backoffMs_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(backoffMs_.get(i)); - } - size += dataSize; - if (!getBackoffMsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - backoffMsMemoizedSerializedSize = dataSize; - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.ReconnectInfo)) { - return super.equals(obj); - } - grpc.testing.Messages.ReconnectInfo other = (grpc.testing.Messages.ReconnectInfo) obj; - - boolean result = true; - result = result && (getPassed() - == other.getPassed()); - result = result && getBackoffMsList() - .equals(other.getBackoffMsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PASSED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getPassed()); - if (getBackoffMsCount() > 0) { - hash = (37 * hash) + BACKOFF_MS_FIELD_NUMBER; - hash = (53 * hash) + getBackoffMsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.ReconnectInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ReconnectInfo parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.ReconnectInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.ReconnectInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * For reconnect interop test only.
-     * Server tells client whether its reconnects are following the spec and the
-     * reconnect backoffs it saw.
-     * 
- * - * Protobuf type {@code grpc.testing.ReconnectInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.ReconnectInfo) - grpc.testing.Messages.ReconnectInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectInfo_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.ReconnectInfo.class, grpc.testing.Messages.ReconnectInfo.Builder.class); - } - - // Construct using grpc.testing.Messages.ReconnectInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - passed_ = false; - - backoffMs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_ReconnectInfo_descriptor; - } - - public grpc.testing.Messages.ReconnectInfo getDefaultInstanceForType() { - return grpc.testing.Messages.ReconnectInfo.getDefaultInstance(); - } - - public grpc.testing.Messages.ReconnectInfo build() { - grpc.testing.Messages.ReconnectInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.ReconnectInfo buildPartial() { - grpc.testing.Messages.ReconnectInfo result = new grpc.testing.Messages.ReconnectInfo(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.passed_ = passed_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - backoffMs_ = java.util.Collections.unmodifiableList(backoffMs_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.backoffMs_ = backoffMs_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.ReconnectInfo) { - return mergeFrom((grpc.testing.Messages.ReconnectInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.ReconnectInfo other) { - if (other == grpc.testing.Messages.ReconnectInfo.getDefaultInstance()) return this; - if (other.getPassed() != false) { - setPassed(other.getPassed()); - } - if (!other.backoffMs_.isEmpty()) { - if (backoffMs_.isEmpty()) { - backoffMs_ = other.backoffMs_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureBackoffMsIsMutable(); - backoffMs_.addAll(other.backoffMs_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.ReconnectInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.ReconnectInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean passed_ ; - /** - * bool passed = 1; - */ - public boolean getPassed() { - return passed_; - } - /** - * bool passed = 1; - */ - public Builder setPassed(boolean value) { - - passed_ = value; - onChanged(); - return this; - } - /** - * bool passed = 1; - */ - public Builder clearPassed() { - - passed_ = false; - onChanged(); - return this; - } - - private java.util.List backoffMs_ = java.util.Collections.emptyList(); - private void ensureBackoffMsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - backoffMs_ = new java.util.ArrayList(backoffMs_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated int32 backoff_ms = 2; - */ - public java.util.List - getBackoffMsList() { - return java.util.Collections.unmodifiableList(backoffMs_); - } - /** - * repeated int32 backoff_ms = 2; - */ - public int getBackoffMsCount() { - return backoffMs_.size(); - } - /** - * repeated int32 backoff_ms = 2; - */ - public int getBackoffMs(int index) { - return backoffMs_.get(index); - } - /** - * repeated int32 backoff_ms = 2; - */ - public Builder setBackoffMs( - int index, int value) { - ensureBackoffMsIsMutable(); - backoffMs_.set(index, value); - onChanged(); - return this; - } - /** - * repeated int32 backoff_ms = 2; - */ - public Builder addBackoffMs(int value) { - ensureBackoffMsIsMutable(); - backoffMs_.add(value); - onChanged(); - return this; - } - /** - * repeated int32 backoff_ms = 2; - */ - public Builder addAllBackoffMs( - java.lang.Iterable values) { - ensureBackoffMsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, backoffMs_); - onChanged(); - return this; - } - /** - * repeated int32 backoff_ms = 2; - */ - public Builder clearBackoffMs() { - backoffMs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.ReconnectInfo) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.ReconnectInfo) - private static final grpc.testing.Messages.ReconnectInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.ReconnectInfo(); - } - - public static grpc.testing.Messages.ReconnectInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ReconnectInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReconnectInfo(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.ReconnectInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface LoadBalancerStatsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.LoadBalancerStatsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Request stats for the next num_rpcs sent by client.
-     * 
- * - * int32 num_rpcs = 1; - */ - int getNumRpcs(); - - /** - *
-     * If num_rpcs have not completed within timeout_sec, return partial results.
-     * 
- * - * int32 timeout_sec = 2; - */ - int getTimeoutSec(); - } - /** - * Protobuf type {@code grpc.testing.LoadBalancerStatsRequest} - */ - public static final class LoadBalancerStatsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.LoadBalancerStatsRequest) - LoadBalancerStatsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use LoadBalancerStatsRequest.newBuilder() to construct. - private LoadBalancerStatsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LoadBalancerStatsRequest() { - numRpcs_ = 0; - timeoutSec_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LoadBalancerStatsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - numRpcs_ = input.readInt32(); - break; - } - case 16: { - - timeoutSec_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.LoadBalancerStatsRequest.class, grpc.testing.Messages.LoadBalancerStatsRequest.Builder.class); - } - - public static final int NUM_RPCS_FIELD_NUMBER = 1; - private int numRpcs_; - /** - *
-     * Request stats for the next num_rpcs sent by client.
-     * 
- * - * int32 num_rpcs = 1; - */ - public int getNumRpcs() { - return numRpcs_; - } - - public static final int TIMEOUT_SEC_FIELD_NUMBER = 2; - private int timeoutSec_; - /** - *
-     * If num_rpcs have not completed within timeout_sec, return partial results.
-     * 
- * - * int32 timeout_sec = 2; - */ - public int getTimeoutSec() { - return timeoutSec_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (numRpcs_ != 0) { - output.writeInt32(1, numRpcs_); - } - if (timeoutSec_ != 0) { - output.writeInt32(2, timeoutSec_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (numRpcs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, numRpcs_); - } - if (timeoutSec_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, timeoutSec_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.LoadBalancerStatsRequest)) { - return super.equals(obj); - } - grpc.testing.Messages.LoadBalancerStatsRequest other = (grpc.testing.Messages.LoadBalancerStatsRequest) obj; - - boolean result = true; - result = result && (getNumRpcs() - == other.getNumRpcs()); - result = result && (getTimeoutSec() - == other.getTimeoutSec()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NUM_RPCS_FIELD_NUMBER; - hash = (53 * hash) + getNumRpcs(); - hash = (37 * hash) + TIMEOUT_SEC_FIELD_NUMBER; - hash = (53 * hash) + getTimeoutSec(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.LoadBalancerStatsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.LoadBalancerStatsRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code grpc.testing.LoadBalancerStatsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.LoadBalancerStatsRequest) - grpc.testing.Messages.LoadBalancerStatsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.LoadBalancerStatsRequest.class, grpc.testing.Messages.LoadBalancerStatsRequest.Builder.class); - } - - // Construct using grpc.testing.Messages.LoadBalancerStatsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - numRpcs_ = 0; - - timeoutSec_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsRequest_descriptor; - } - - public grpc.testing.Messages.LoadBalancerStatsRequest getDefaultInstanceForType() { - return grpc.testing.Messages.LoadBalancerStatsRequest.getDefaultInstance(); - } - - public grpc.testing.Messages.LoadBalancerStatsRequest build() { - grpc.testing.Messages.LoadBalancerStatsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.LoadBalancerStatsRequest buildPartial() { - grpc.testing.Messages.LoadBalancerStatsRequest result = new grpc.testing.Messages.LoadBalancerStatsRequest(this); - result.numRpcs_ = numRpcs_; - result.timeoutSec_ = timeoutSec_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.LoadBalancerStatsRequest) { - return mergeFrom((grpc.testing.Messages.LoadBalancerStatsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.LoadBalancerStatsRequest other) { - if (other == grpc.testing.Messages.LoadBalancerStatsRequest.getDefaultInstance()) return this; - if (other.getNumRpcs() != 0) { - setNumRpcs(other.getNumRpcs()); - } - if (other.getTimeoutSec() != 0) { - setTimeoutSec(other.getTimeoutSec()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.LoadBalancerStatsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.LoadBalancerStatsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int numRpcs_ ; - /** - *
-       * Request stats for the next num_rpcs sent by client.
-       * 
- * - * int32 num_rpcs = 1; - */ - public int getNumRpcs() { - return numRpcs_; - } - /** - *
-       * Request stats for the next num_rpcs sent by client.
-       * 
- * - * int32 num_rpcs = 1; - */ - public Builder setNumRpcs(int value) { - - numRpcs_ = value; - onChanged(); - return this; - } - /** - *
-       * Request stats for the next num_rpcs sent by client.
-       * 
- * - * int32 num_rpcs = 1; - */ - public Builder clearNumRpcs() { - - numRpcs_ = 0; - onChanged(); - return this; - } - - private int timeoutSec_ ; - /** - *
-       * If num_rpcs have not completed within timeout_sec, return partial results.
-       * 
- * - * int32 timeout_sec = 2; - */ - public int getTimeoutSec() { - return timeoutSec_; - } - /** - *
-       * If num_rpcs have not completed within timeout_sec, return partial results.
-       * 
- * - * int32 timeout_sec = 2; - */ - public Builder setTimeoutSec(int value) { - - timeoutSec_ = value; - onChanged(); - return this; - } - /** - *
-       * If num_rpcs have not completed within timeout_sec, return partial results.
-       * 
- * - * int32 timeout_sec = 2; - */ - public Builder clearTimeoutSec() { - - timeoutSec_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.LoadBalancerStatsRequest) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.LoadBalancerStatsRequest) - private static final grpc.testing.Messages.LoadBalancerStatsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.LoadBalancerStatsRequest(); - } - - public static grpc.testing.Messages.LoadBalancerStatsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public LoadBalancerStatsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LoadBalancerStatsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.LoadBalancerStatsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface LoadBalancerStatsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.testing.LoadBalancerStatsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - int getRpcsByPeerCount(); - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - boolean containsRpcsByPeer( - java.lang.String key); - /** - * Use {@link #getRpcsByPeerMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getRpcsByPeer(); - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - java.util.Map - getRpcsByPeerMap(); - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - int getRpcsByPeerOrDefault( - java.lang.String key, - int defaultValue); - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - int getRpcsByPeerOrThrow( - java.lang.String key); - - /** - *
-     * The number of RPCs that failed to record a remote peer.
-     * 
- * - * int32 num_failures = 2; - */ - int getNumFailures(); - } - /** - * Protobuf type {@code grpc.testing.LoadBalancerStatsResponse} - */ - public static final class LoadBalancerStatsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.testing.LoadBalancerStatsResponse) - LoadBalancerStatsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use LoadBalancerStatsResponse.newBuilder() to construct. - private LoadBalancerStatsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LoadBalancerStatsResponse() { - numFailures_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LoadBalancerStatsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - rpcsByPeer_ = com.google.protobuf.MapField.newMapField( - RpcsByPeerDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - rpcsByPeer__ = input.readMessage( - RpcsByPeerDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - rpcsByPeer_.getMutableMap().put( - rpcsByPeer__.getKey(), rpcsByPeer__.getValue()); - break; - } - case 16: { - - numFailures_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetRpcsByPeer(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.LoadBalancerStatsResponse.class, grpc.testing.Messages.LoadBalancerStatsResponse.Builder.class); - } - - private int bitField0_; - public static final int RPCS_BY_PEER_FIELD_NUMBER = 1; - private static final class RpcsByPeerDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.Integer> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsResponse_RpcsByPeerEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.INT32, - 0); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.Integer> rpcsByPeer_; - private com.google.protobuf.MapField - internalGetRpcsByPeer() { - if (rpcsByPeer_ == null) { - return com.google.protobuf.MapField.emptyMapField( - RpcsByPeerDefaultEntryHolder.defaultEntry); - } - return rpcsByPeer_; - } - - public int getRpcsByPeerCount() { - return internalGetRpcsByPeer().getMap().size(); - } - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public boolean containsRpcsByPeer( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetRpcsByPeer().getMap().containsKey(key); - } - /** - * Use {@link #getRpcsByPeerMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getRpcsByPeer() { - return getRpcsByPeerMap(); - } - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public java.util.Map getRpcsByPeerMap() { - return internalGetRpcsByPeer().getMap(); - } - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public int getRpcsByPeerOrDefault( - java.lang.String key, - int defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRpcsByPeer().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * The number of completed RPCs for each peer.
-     * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public int getRpcsByPeerOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRpcsByPeer().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int NUM_FAILURES_FIELD_NUMBER = 2; - private int numFailures_; - /** - *
-     * The number of RPCs that failed to record a remote peer.
-     * 
- * - * int32 num_failures = 2; - */ - public int getNumFailures() { - return numFailures_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetRpcsByPeer(), - RpcsByPeerDefaultEntryHolder.defaultEntry, - 1); - if (numFailures_ != 0) { - output.writeInt32(2, numFailures_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (java.util.Map.Entry entry - : internalGetRpcsByPeer().getMap().entrySet()) { - com.google.protobuf.MapEntry - rpcsByPeer__ = RpcsByPeerDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, rpcsByPeer__); - } - if (numFailures_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, numFailures_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof grpc.testing.Messages.LoadBalancerStatsResponse)) { - return super.equals(obj); - } - grpc.testing.Messages.LoadBalancerStatsResponse other = (grpc.testing.Messages.LoadBalancerStatsResponse) obj; - - boolean result = true; - result = result && internalGetRpcsByPeer().equals( - other.internalGetRpcsByPeer()); - result = result && (getNumFailures() - == other.getNumFailures()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (!internalGetRpcsByPeer().getMap().isEmpty()) { - hash = (37 * hash) + RPCS_BY_PEER_FIELD_NUMBER; - hash = (53 * hash) + internalGetRpcsByPeer().hashCode(); - } - hash = (37 * hash) + NUM_FAILURES_FIELD_NUMBER; - hash = (53 * hash) + getNumFailures(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static grpc.testing.Messages.LoadBalancerStatsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(grpc.testing.Messages.LoadBalancerStatsResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code grpc.testing.LoadBalancerStatsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.testing.LoadBalancerStatsResponse) - grpc.testing.Messages.LoadBalancerStatsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetRpcsByPeer(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableRpcsByPeer(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - grpc.testing.Messages.LoadBalancerStatsResponse.class, grpc.testing.Messages.LoadBalancerStatsResponse.Builder.class); - } - - // Construct using grpc.testing.Messages.LoadBalancerStatsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - internalGetMutableRpcsByPeer().clear(); - numFailures_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return grpc.testing.Messages.internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor; - } - - public grpc.testing.Messages.LoadBalancerStatsResponse getDefaultInstanceForType() { - return grpc.testing.Messages.LoadBalancerStatsResponse.getDefaultInstance(); - } - - public grpc.testing.Messages.LoadBalancerStatsResponse build() { - grpc.testing.Messages.LoadBalancerStatsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public grpc.testing.Messages.LoadBalancerStatsResponse buildPartial() { - grpc.testing.Messages.LoadBalancerStatsResponse result = new grpc.testing.Messages.LoadBalancerStatsResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.rpcsByPeer_ = internalGetRpcsByPeer(); - result.rpcsByPeer_.makeImmutable(); - result.numFailures_ = numFailures_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof grpc.testing.Messages.LoadBalancerStatsResponse) { - return mergeFrom((grpc.testing.Messages.LoadBalancerStatsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(grpc.testing.Messages.LoadBalancerStatsResponse other) { - if (other == grpc.testing.Messages.LoadBalancerStatsResponse.getDefaultInstance()) return this; - internalGetMutableRpcsByPeer().mergeFrom( - other.internalGetRpcsByPeer()); - if (other.getNumFailures() != 0) { - setNumFailures(other.getNumFailures()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - grpc.testing.Messages.LoadBalancerStatsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (grpc.testing.Messages.LoadBalancerStatsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, java.lang.Integer> rpcsByPeer_; - private com.google.protobuf.MapField - internalGetRpcsByPeer() { - if (rpcsByPeer_ == null) { - return com.google.protobuf.MapField.emptyMapField( - RpcsByPeerDefaultEntryHolder.defaultEntry); - } - return rpcsByPeer_; - } - private com.google.protobuf.MapField - internalGetMutableRpcsByPeer() { - onChanged();; - if (rpcsByPeer_ == null) { - rpcsByPeer_ = com.google.protobuf.MapField.newMapField( - RpcsByPeerDefaultEntryHolder.defaultEntry); - } - if (!rpcsByPeer_.isMutable()) { - rpcsByPeer_ = rpcsByPeer_.copy(); - } - return rpcsByPeer_; - } - - public int getRpcsByPeerCount() { - return internalGetRpcsByPeer().getMap().size(); - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public boolean containsRpcsByPeer( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetRpcsByPeer().getMap().containsKey(key); - } - /** - * Use {@link #getRpcsByPeerMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getRpcsByPeer() { - return getRpcsByPeerMap(); - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public java.util.Map getRpcsByPeerMap() { - return internalGetRpcsByPeer().getMap(); - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public int getRpcsByPeerOrDefault( - java.lang.String key, - int defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRpcsByPeer().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public int getRpcsByPeerOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRpcsByPeer().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearRpcsByPeer() { - internalGetMutableRpcsByPeer().getMutableMap() - .clear(); - return this; - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public Builder removeRpcsByPeer( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableRpcsByPeer().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableRpcsByPeer() { - return internalGetMutableRpcsByPeer().getMutableMap(); - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - public Builder putRpcsByPeer( - java.lang.String key, - int value) { - if (key == null) { throw new java.lang.NullPointerException(); } - - internalGetMutableRpcsByPeer().getMutableMap() - .put(key, value); - return this; - } - /** - *
-       * The number of completed RPCs for each peer.
-       * 
- * - * map<string, int32> rpcs_by_peer = 1; - */ - - public Builder putAllRpcsByPeer( - java.util.Map values) { - internalGetMutableRpcsByPeer().getMutableMap() - .putAll(values); - return this; - } - - private int numFailures_ ; - /** - *
-       * The number of RPCs that failed to record a remote peer.
-       * 
- * - * int32 num_failures = 2; - */ - public int getNumFailures() { - return numFailures_; - } - /** - *
-       * The number of RPCs that failed to record a remote peer.
-       * 
- * - * int32 num_failures = 2; - */ - public Builder setNumFailures(int value) { - - numFailures_ = value; - onChanged(); - return this; - } - /** - *
-       * The number of RPCs that failed to record a remote peer.
-       * 
- * - * int32 num_failures = 2; - */ - public Builder clearNumFailures() { - - numFailures_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.testing.LoadBalancerStatsResponse) - } - - // @@protoc_insertion_point(class_scope:grpc.testing.LoadBalancerStatsResponse) - private static final grpc.testing.Messages.LoadBalancerStatsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new grpc.testing.Messages.LoadBalancerStatsResponse(); - } - - public static grpc.testing.Messages.LoadBalancerStatsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public LoadBalancerStatsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LoadBalancerStatsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public grpc.testing.Messages.LoadBalancerStatsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_BoolValue_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_BoolValue_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_Payload_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_Payload_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_EchoStatus_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_EchoStatus_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_SimpleRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_SimpleRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_SimpleResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_SimpleResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_StreamingInputCallRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_StreamingInputCallRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_StreamingInputCallResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_StreamingInputCallResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_ResponseParameters_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_ResponseParameters_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_StreamingOutputCallRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_StreamingOutputCallRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_StreamingOutputCallResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_StreamingOutputCallResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_ReconnectParams_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_ReconnectParams_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_ReconnectInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_ReconnectInfo_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_LoadBalancerStatsRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_LoadBalancerStatsRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_LoadBalancerStatsResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_testing_LoadBalancerStatsResponse_RpcsByPeerEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_testing_LoadBalancerStatsResponse_RpcsByPeerEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\033grpc/testing/messages.proto\022\014grpc.test" + - "ing\"\032\n\tBoolValue\022\r\n\005value\030\001 \001(\010\"@\n\007Paylo" + - "ad\022\'\n\004type\030\001 \001(\0162\031.grpc.testing.PayloadT" + - "ype\022\014\n\004body\030\002 \001(\014\"+\n\nEchoStatus\022\014\n\004code\030" + - "\001 \001(\005\022\017\n\007message\030\002 \001(\t\"\206\003\n\rSimpleRequest" + - "\0220\n\rresponse_type\030\001 \001(\0162\031.grpc.testing.P" + - "ayloadType\022\025\n\rresponse_size\030\002 \001(\005\022&\n\007pay" + - "load\030\003 \001(\0132\025.grpc.testing.Payload\022\025\n\rfil" + - "l_username\030\004 \001(\010\022\030\n\020fill_oauth_scope\030\005 \001" + - "(\010\0224\n\023response_compressed\030\006 \001(\0132\027.grpc.t", - "esting.BoolValue\0221\n\017response_status\030\007 \001(" + - "\0132\030.grpc.testing.EchoStatus\0222\n\021expect_co" + - "mpressed\030\010 \001(\0132\027.grpc.testing.BoolValue\022" + - "\026\n\016fill_server_id\030\t \001(\010\022\036\n\026fill_grpclb_r" + - "oute_type\030\n \001(\010\"\276\001\n\016SimpleResponse\022&\n\007pa" + - "yload\030\001 \001(\0132\025.grpc.testing.Payload\022\020\n\010us" + - "ername\030\002 \001(\t\022\023\n\013oauth_scope\030\003 \001(\t\022\021\n\tser" + - "ver_id\030\004 \001(\t\0228\n\021grpclb_route_type\030\005 \001(\0162" + - "\035.grpc.testing.GrpclbRouteType\022\020\n\010hostna" + - "me\030\006 \001(\t\"w\n\031StreamingInputCallRequest\022&\n", - "\007payload\030\001 \001(\0132\025.grpc.testing.Payload\0222\n" + - "\021expect_compressed\030\002 \001(\0132\027.grpc.testing." + - "BoolValue\"=\n\032StreamingInputCallResponse\022" + - "\037\n\027aggregated_payload_size\030\001 \001(\005\"d\n\022Resp" + - "onseParameters\022\014\n\004size\030\001 \001(\005\022\023\n\013interval" + - "_us\030\002 \001(\005\022+\n\ncompressed\030\003 \001(\0132\027.grpc.tes" + - "ting.BoolValue\"\350\001\n\032StreamingOutputCallRe" + - "quest\0220\n\rresponse_type\030\001 \001(\0162\031.grpc.test" + - "ing.PayloadType\022=\n\023response_parameters\030\002" + - " \003(\0132 .grpc.testing.ResponseParameters\022&", - "\n\007payload\030\003 \001(\0132\025.grpc.testing.Payload\0221" + - "\n\017response_status\030\007 \001(\0132\030.grpc.testing.E" + - "choStatus\"E\n\033StreamingOutputCallResponse" + - "\022&\n\007payload\030\001 \001(\0132\025.grpc.testing.Payload" + - "\"3\n\017ReconnectParams\022 \n\030max_reconnect_bac" + - "koff_ms\030\001 \001(\005\"3\n\rReconnectInfo\022\016\n\006passed" + - "\030\001 \001(\010\022\022\n\nbackoff_ms\030\002 \003(\005\"A\n\030LoadBalanc" + - "erStatsRequest\022\020\n\010num_rpcs\030\001 \001(\005\022\023\n\013time" + - "out_sec\030\002 \001(\005\"\263\001\n\031LoadBalancerStatsRespo" + - "nse\022M\n\014rpcs_by_peer\030\001 \003(\01327.grpc.testing", - ".LoadBalancerStatsResponse.RpcsByPeerEnt" + - "ry\022\024\n\014num_failures\030\002 \001(\005\0321\n\017RpcsByPeerEn" + - "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\005:\0028\001*\037\n\013P" + - "ayloadType\022\020\n\014COMPRESSABLE\020\000*o\n\017GrpclbRo" + - "uteType\022\035\n\031GRPCLB_ROUTE_TYPE_UNKNOWN\020\000\022\036" + - "\n\032GRPCLB_ROUTE_TYPE_FALLBACK\020\001\022\035\n\031GRPCLB" + - "_ROUTE_TYPE_BACKEND\020\002b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_grpc_testing_BoolValue_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_grpc_testing_BoolValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_BoolValue_descriptor, - new java.lang.String[] { "Value", }); - internal_static_grpc_testing_Payload_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_grpc_testing_Payload_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_Payload_descriptor, - new java.lang.String[] { "Type", "Body", }); - internal_static_grpc_testing_EchoStatus_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_grpc_testing_EchoStatus_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_EchoStatus_descriptor, - new java.lang.String[] { "Code", "Message", }); - internal_static_grpc_testing_SimpleRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_grpc_testing_SimpleRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_SimpleRequest_descriptor, - new java.lang.String[] { "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed", "FillServerId", "FillGrpclbRouteType", }); - internal_static_grpc_testing_SimpleResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_grpc_testing_SimpleResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_SimpleResponse_descriptor, - new java.lang.String[] { "Payload", "Username", "OauthScope", "ServerId", "GrpclbRouteType", "Hostname", }); - internal_static_grpc_testing_StreamingInputCallRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_grpc_testing_StreamingInputCallRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_StreamingInputCallRequest_descriptor, - new java.lang.String[] { "Payload", "ExpectCompressed", }); - internal_static_grpc_testing_StreamingInputCallResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_grpc_testing_StreamingInputCallResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_StreamingInputCallResponse_descriptor, - new java.lang.String[] { "AggregatedPayloadSize", }); - internal_static_grpc_testing_ResponseParameters_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_grpc_testing_ResponseParameters_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_ResponseParameters_descriptor, - new java.lang.String[] { "Size", "IntervalUs", "Compressed", }); - internal_static_grpc_testing_StreamingOutputCallRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_grpc_testing_StreamingOutputCallRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_StreamingOutputCallRequest_descriptor, - new java.lang.String[] { "ResponseType", "ResponseParameters", "Payload", "ResponseStatus", }); - internal_static_grpc_testing_StreamingOutputCallResponse_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_grpc_testing_StreamingOutputCallResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_StreamingOutputCallResponse_descriptor, - new java.lang.String[] { "Payload", }); - internal_static_grpc_testing_ReconnectParams_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_grpc_testing_ReconnectParams_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_ReconnectParams_descriptor, - new java.lang.String[] { "MaxReconnectBackoffMs", }); - internal_static_grpc_testing_ReconnectInfo_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_grpc_testing_ReconnectInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_ReconnectInfo_descriptor, - new java.lang.String[] { "Passed", "BackoffMs", }); - internal_static_grpc_testing_LoadBalancerStatsRequest_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_grpc_testing_LoadBalancerStatsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_LoadBalancerStatsRequest_descriptor, - new java.lang.String[] { "NumRpcs", "TimeoutSec", }); - internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_grpc_testing_LoadBalancerStatsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor, - new java.lang.String[] { "RpcsByPeer", "NumFailures", }); - internal_static_grpc_testing_LoadBalancerStatsResponse_RpcsByPeerEntry_descriptor = - internal_static_grpc_testing_LoadBalancerStatsResponse_descriptor.getNestedTypes().get(0); - internal_static_grpc_testing_LoadBalancerStatsResponse_RpcsByPeerEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_testing_LoadBalancerStatsResponse_RpcsByPeerEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/connector/src/main/java/grpc/testing/TestFromProto.java b/src/connector/src/main/java/grpc/testing/TestFromProto.java deleted file mode 100644 index d9d026f0..00000000 --- a/src/connector/src/main/java/grpc/testing/TestFromProto.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: grpc/testing/test.proto - -package grpc.testing; - -/** - * ******* DO NOT EDIT ******* - * Generated by proto compiler from protos in the following dir - * https://github.com/grpc/grpc/tree/master/src/proto/grpc/testing - */ -public final class TestFromProto { - private TestFromProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\027grpc/testing/test.proto\022\014grpc.testing\032" + - "\030grpc/testing/empty.proto\032\033grpc/testing/" + - "messages.proto2\313\005\n\013TestService\0225\n\tEmptyC" + - "all\022\023.grpc.testing.Empty\032\023.grpc.testing." + - "Empty\022F\n\tUnaryCall\022\033.grpc.testing.Simple" + - "Request\032\034.grpc.testing.SimpleResponse\022O\n" + - "\022CacheableUnaryCall\022\033.grpc.testing.Simpl" + - "eRequest\032\034.grpc.testing.SimpleResponse\022l" + - "\n\023StreamingOutputCall\022(.grpc.testing.Str" + - "eamingOutputCallRequest\032).grpc.testing.S", - "treamingOutputCallResponse0\001\022i\n\022Streamin" + - "gInputCall\022\'.grpc.testing.StreamingInput" + - "CallRequest\032(.grpc.testing.StreamingInpu" + - "tCallResponse(\001\022i\n\016FullDuplexCall\022(.grpc" + - ".testing.StreamingOutputCallRequest\032).gr" + - "pc.testing.StreamingOutputCallResponse(\001" + - "0\001\022i\n\016HalfDuplexCall\022(.grpc.testing.Stre" + - "amingOutputCallRequest\032).grpc.testing.St" + - "reamingOutputCallResponse(\0010\001\022=\n\021Unimple" + - "mentedCall\022\023.grpc.testing.Empty\032\023.grpc.t", - "esting.Empty2U\n\024UnimplementedService\022=\n\021" + - "UnimplementedCall\022\023.grpc.testing.Empty\032\023" + - ".grpc.testing.Empty2\211\001\n\020ReconnectService" + - "\022;\n\005Start\022\035.grpc.testing.ReconnectParams" + - "\032\023.grpc.testing.Empty\0228\n\004Stop\022\023.grpc.tes" + - "ting.Empty\032\033.grpc.testing.ReconnectInfo2" + - "\177\n\030LoadBalancerStatsService\022c\n\016GetClient" + - "Stats\022&.grpc.testing.LoadBalancerStatsRe" + - "quest\032\'.grpc.testing.LoadBalancerStatsRe" + - "sponse\"\000b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - grpc.testing.EmptyOuterClass.getDescriptor(), - grpc.testing.Messages.getDescriptor(), - }, assigner); - grpc.testing.EmptyOuterClass.getDescriptor(); - grpc.testing.Messages.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/connector/src/main/java/grpc/testing/TestServiceGrpc.java b/src/connector/src/main/java/grpc/testing/TestServiceGrpc.java deleted file mode 100644 index c56a9074..00000000 --- a/src/connector/src/main/java/grpc/testing/TestServiceGrpc.java +++ /dev/null @@ -1,730 +0,0 @@ -package grpc.testing; - -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; - -import grpc.testing.Messages.SimpleRequest; -import grpc.testing.Messages.SimpleResponse; -import io.grpc.stub.StreamObserver; - -/** - * ******* DO NOT EDIT ******* - * Generated by proto compiler from protos in the following dir - * https://github.com/grpc/grpc/tree/master/src/proto/grpc/testing - * - * - *
- * A simple service to test the various types of RPCs and experiment with
- * performance with various types of payload.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.7.0)", - comments = "Source: grpc/testing/test.proto") -public final class TestServiceGrpc { - - private TestServiceGrpc() {} - - public static final String SERVICE_NAME = "grpc.testing.TestService"; - - // Static method descriptors that strictly reflect the proto. - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_EMPTY_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "EmptyCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.EmptyOuterClass.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.EmptyOuterClass.Empty.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("EmptyCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_UNARY_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "UnaryCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.SimpleRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.SimpleResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("UnaryCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_CACHEABLE_UNARY_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "CacheableUnaryCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.SimpleRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.SimpleResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("CacheableUnaryCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_STREAMING_OUTPUT_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "StreamingOutputCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingOutputCallRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingOutputCallResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("StreamingOutputCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_STREAMING_INPUT_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "StreamingInputCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingInputCallRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingInputCallResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("StreamingInputCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_FULL_DUPLEX_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "FullDuplexCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingOutputCallRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingOutputCallResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("FullDuplexCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_HALF_DUPLEX_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "HalfDuplexCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingOutputCallRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.Messages.StreamingOutputCallResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("HalfDuplexCall")) - .build(); - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static final io.grpc.MethodDescriptor METHOD_UNIMPLEMENTED_CALL = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "grpc.testing.TestService", "UnimplementedCall")) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.EmptyOuterClass.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - grpc.testing.EmptyOuterClass.Empty.getDefaultInstance())) - .setSchemaDescriptor(new TestServiceMethodDescriptorSupplier("UnimplementedCall")) - .build(); - - /** - * 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 calls on the service - */ - public static TestServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - return new TestServiceFutureStub(channel); - } - - /** - *
-   * A simple service to test the various types of RPCs and experiment with
-   * performance with various types of payload.
-   * 
- */ - public static abstract class TestServiceImplBase implements io.grpc.BindableService { - - /** - *
-     * One empty request followed by one empty response.
-     * 
- */ - public void emptyCall(grpc.testing.EmptyOuterClass.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(METHOD_EMPTY_CALL, responseObserver); - } - - /** - *
-     * One request followed by one response.
-     * 
- */ - public void unaryCall(grpc.testing.Messages.SimpleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver); - } - - /** - *
-     * One request followed by one response. Response has cache control
-     * headers set such that a caching HTTP proxy (such as GFE) can
-     * satisfy subsequent requests.
-     * 
- */ - public void cacheableUnaryCall(grpc.testing.Messages.SimpleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(METHOD_CACHEABLE_UNARY_CALL, responseObserver); - } - - /** - *
-     * One request followed by a sequence of responses (streamed download).
-     * The server returns the payload with client desired type and sizes.
-     * 
- */ - public void streamingOutputCall(grpc.testing.Messages.StreamingOutputCallRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver); - } - - /** - *
-     * A sequence of requests followed by one response (streamed upload).
-     * The server returns the aggregated size of client payload as the result.
-     * 
- */ - public io.grpc.stub.StreamObserver streamingInputCall( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver); - } - - /** - *
-     * 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 duplexing.
-     * 
- */ - public io.grpc.stub.StreamObserver fullDuplexCall( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(METHOD_FULL_DUPLEX_CALL, responseObserver); - } - - /** - *
-     * 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.
-     * 
- */ - public io.grpc.stub.StreamObserver halfDuplexCall( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(METHOD_HALF_DUPLEX_CALL, responseObserver); - } - - /** - *
-     * The test server will not implement this method. It will be used
-     * to test the behavior when clients call unimplemented methods.
-     * 
- */ - public void unimplementedCall(grpc.testing.EmptyOuterClass.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(METHOD_UNIMPLEMENTED_CALL, responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - METHOD_EMPTY_CALL, - asyncUnaryCall( - new MethodHandlers< - grpc.testing.EmptyOuterClass.Empty, - grpc.testing.EmptyOuterClass.Empty>( - this, METHODID_EMPTY_CALL))) - .addMethod( - METHOD_UNARY_CALL, - asyncUnaryCall( - new MethodHandlers< - grpc.testing.Messages.SimpleRequest, - grpc.testing.Messages.SimpleResponse>( - this, METHODID_UNARY_CALL))) - .addMethod( - METHOD_CACHEABLE_UNARY_CALL, - asyncUnaryCall( - new MethodHandlers< - grpc.testing.Messages.SimpleRequest, - grpc.testing.Messages.SimpleResponse>( - this, METHODID_CACHEABLE_UNARY_CALL))) - .addMethod( - METHOD_STREAMING_OUTPUT_CALL, - asyncServerStreamingCall( - new MethodHandlers< - grpc.testing.Messages.StreamingOutputCallRequest, - grpc.testing.Messages.StreamingOutputCallResponse>( - this, METHODID_STREAMING_OUTPUT_CALL))) - .addMethod( - METHOD_STREAMING_INPUT_CALL, - asyncClientStreamingCall( - new MethodHandlers< - grpc.testing.Messages.StreamingInputCallRequest, - grpc.testing.Messages.StreamingInputCallResponse>( - this, METHODID_STREAMING_INPUT_CALL))) - .addMethod( - METHOD_FULL_DUPLEX_CALL, - asyncBidiStreamingCall( - new MethodHandlers< - grpc.testing.Messages.StreamingOutputCallRequest, - grpc.testing.Messages.StreamingOutputCallResponse>( - this, METHODID_FULL_DUPLEX_CALL))) - .addMethod( - METHOD_HALF_DUPLEX_CALL, - asyncBidiStreamingCall( - new MethodHandlers< - grpc.testing.Messages.StreamingOutputCallRequest, - grpc.testing.Messages.StreamingOutputCallResponse>( - this, METHODID_HALF_DUPLEX_CALL))) - .addMethod( - METHOD_UNIMPLEMENTED_CALL, - asyncUnaryCall( - new MethodHandlers< - grpc.testing.EmptyOuterClass.Empty, - grpc.testing.EmptyOuterClass.Empty>( - this, METHODID_UNIMPLEMENTED_CALL))) - .build(); - } - } - - /** - *
-   * A simple service to test the various types of RPCs and experiment with
-   * performance with various types of payload.
-   * 
- */ - public static final class TestServiceStub extends io.grpc.stub.AbstractStub { - private TestServiceStub(io.grpc.Channel channel) { - super(channel); - } - - private TestServiceStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected TestServiceStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new TestServiceStub(channel, callOptions); - } - - /** - *
-     * One empty request followed by one empty response.
-     * 
- */ - public void emptyCall(grpc.testing.EmptyOuterClass.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_EMPTY_CALL, getCallOptions()), request, responseObserver); - } - - /** - *
-     * One request followed by one response.
-     * 
- */ - public void unaryCall(grpc.testing.Messages.SimpleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver); - } - - /** - *
-     * One request followed by one response. Response has cache control
-     * headers set such that a caching HTTP proxy (such as GFE) can
-     * satisfy subsequent requests.
-     * 
- */ - public void cacheableUnaryCall(grpc.testing.Messages.SimpleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_CACHEABLE_UNARY_CALL, getCallOptions()), request, responseObserver); - } - - /** - *
-     * One request followed by a sequence of responses (streamed download).
-     * The server returns the payload with client desired type and sizes.
-     * 
- */ - public void streamingOutputCall(grpc.testing.Messages.StreamingOutputCallRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncServerStreamingCall( - getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver); - } - - /** - *
-     * A sequence of requests followed by one response (streamed upload).
-     * The server returns the aggregated size of client payload as the result.
-     * 
- */ - public io.grpc.stub.StreamObserver streamingInputCall( - io.grpc.stub.StreamObserver responseObserver) { - return asyncClientStreamingCall( - getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver); - } - - /** - *
-     * 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 duplexing.
-     * 
- */ - public io.grpc.stub.StreamObserver fullDuplexCall( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(METHOD_FULL_DUPLEX_CALL, getCallOptions()), responseObserver); - } - - /** - *
-     * 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.
-     * 
- */ - public io.grpc.stub.StreamObserver halfDuplexCall( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(METHOD_HALF_DUPLEX_CALL, getCallOptions()), responseObserver); - } - - /** - *
-     * The test server will not implement this method. It will be used
-     * to test the behavior when clients call unimplemented methods.
-     * 
- */ - public void unimplementedCall(grpc.testing.EmptyOuterClass.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_UNIMPLEMENTED_CALL, getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * A simple service to test the various types of RPCs and experiment with
-   * performance with various types of payload.
-   * 
- */ - public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractStub { - private TestServiceBlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private TestServiceBlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected TestServiceBlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new TestServiceBlockingStub(channel, callOptions); - } - - /** - *
-     * One empty request followed by one empty response.
-     * 
- */ - public grpc.testing.EmptyOuterClass.Empty emptyCall(grpc.testing.EmptyOuterClass.Empty request) { - return blockingUnaryCall( - getChannel(), METHOD_EMPTY_CALL, getCallOptions(), request); - } - - /** - *
-     * One request followed by one response.
-     * 
- */ - public grpc.testing.Messages.SimpleResponse unaryCall(grpc.testing.Messages.SimpleRequest request) { - return blockingUnaryCall( - getChannel(), METHOD_UNARY_CALL, getCallOptions(), request); - } - - /** - *
-     * One request followed by one response. Response has cache control
-     * headers set such that a caching HTTP proxy (such as GFE) can
-     * satisfy subsequent requests.
-     * 
- */ - public grpc.testing.Messages.SimpleResponse cacheableUnaryCall(grpc.testing.Messages.SimpleRequest request) { - return blockingUnaryCall( - getChannel(), METHOD_CACHEABLE_UNARY_CALL, getCallOptions(), request); - } - - /** - *
-     * One request followed by a sequence of responses (streamed download).
-     * The server returns the payload with client desired type and sizes.
-     * 
- */ - public java.util.Iterator streamingOutputCall( - grpc.testing.Messages.StreamingOutputCallRequest request) { - return blockingServerStreamingCall( - getChannel(), METHOD_STREAMING_OUTPUT_CALL, getCallOptions(), request); - } - - /** - *
-     * The test server will not implement this method. It will be used
-     * to test the behavior when clients call unimplemented methods.
-     * 
- */ - public grpc.testing.EmptyOuterClass.Empty unimplementedCall(grpc.testing.EmptyOuterClass.Empty request) { - return blockingUnaryCall( - getChannel(), METHOD_UNIMPLEMENTED_CALL, getCallOptions(), request); - } - } - - /** - *
-   * A simple service to test the various types of RPCs and experiment with
-   * performance with various types of payload.
-   * 
- */ - public static final class TestServiceFutureStub extends io.grpc.stub.AbstractStub { - private TestServiceFutureStub(io.grpc.Channel channel) { - super(channel); - } - - private TestServiceFutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected TestServiceFutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new TestServiceFutureStub(channel, callOptions); - } - - /** - *
-     * One empty request followed by one empty response.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture emptyCall( - grpc.testing.EmptyOuterClass.Empty request) { - return futureUnaryCall( - getChannel().newCall(METHOD_EMPTY_CALL, getCallOptions()), request); - } - - /** - *
-     * One request followed by one response.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture unaryCall( - grpc.testing.Messages.SimpleRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request); - } - - /** - *
-     * One request followed by one response. Response has cache control
-     * headers set such that a caching HTTP proxy (such as GFE) can
-     * satisfy subsequent requests.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture cacheableUnaryCall( - grpc.testing.Messages.SimpleRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_CACHEABLE_UNARY_CALL, getCallOptions()), request); - } - - /** - *
-     * The test server will not implement this method. It will be used
-     * to test the behavior when clients call unimplemented methods.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture unimplementedCall( - grpc.testing.EmptyOuterClass.Empty request) { - return futureUnaryCall( - getChannel().newCall(METHOD_UNIMPLEMENTED_CALL, getCallOptions()), request); - } - } - - private static final int METHODID_EMPTY_CALL = 0; - private static final int METHODID_UNARY_CALL = 1; - private static final int METHODID_CACHEABLE_UNARY_CALL = 2; - private static final int METHODID_STREAMING_OUTPUT_CALL = 3; - private static final int METHODID_UNIMPLEMENTED_CALL = 4; - private static final int METHODID_STREAMING_INPUT_CALL = 5; - private static final int METHODID_FULL_DUPLEX_CALL = 6; - private static final int METHODID_HALF_DUPLEX_CALL = 7; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final TestServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(TestServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_EMPTY_CALL: - serviceImpl.emptyCall((grpc.testing.EmptyOuterClass.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UNARY_CALL: - serviceImpl.unaryCall((grpc.testing.Messages.SimpleRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CACHEABLE_UNARY_CALL: - serviceImpl.cacheableUnaryCall((grpc.testing.Messages.SimpleRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_STREAMING_OUTPUT_CALL: - serviceImpl.streamingOutputCall((grpc.testing.Messages.StreamingOutputCallRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UNIMPLEMENTED_CALL: - serviceImpl.unimplementedCall((grpc.testing.EmptyOuterClass.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAMING_INPUT_CALL: - return (io.grpc.stub.StreamObserver) serviceImpl.streamingInputCall( - (io.grpc.stub.StreamObserver) responseObserver); - case METHODID_FULL_DUPLEX_CALL: - return (io.grpc.stub.StreamObserver) serviceImpl.fullDuplexCall( - (io.grpc.stub.StreamObserver) responseObserver); - case METHODID_HALF_DUPLEX_CALL: - return (io.grpc.stub.StreamObserver) serviceImpl.halfDuplexCall( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class TestServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - TestServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return TestFromProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("TestService"); - } - } - - private static final class TestServiceFileDescriptorSupplier - extends TestServiceBaseDescriptorSupplier { - TestServiceFileDescriptorSupplier() {} - } - - private static final class TestServiceMethodDescriptorSupplier - extends TestServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - TestServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (TestServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new TestServiceFileDescriptorSupplier()) - .addMethod(METHOD_EMPTY_CALL) - .addMethod(METHOD_UNARY_CALL) - .addMethod(METHOD_CACHEABLE_UNARY_CALL) - .addMethod(METHOD_STREAMING_OUTPUT_CALL) - .addMethod(METHOD_STREAMING_INPUT_CALL) - .addMethod(METHOD_FULL_DUPLEX_CALL) - .addMethod(METHOD_HALF_DUPLEX_CALL) - .addMethod(METHOD_UNIMPLEMENTED_CALL) - .build(); - } - } - } - return result; - } -} diff --git a/src/connector/src/main/java/grpc/testing/main/TestService.java b/src/connector/src/main/java/grpc/testing/main/TestService.java deleted file mode 100644 index 15675819..00000000 --- a/src/connector/src/main/java/grpc/testing/main/TestService.java +++ /dev/null @@ -1,68 +0,0 @@ -package grpc.testing.main; - -import com.google.protobuf.ByteString; -import grpc.testing.EmptyOuterClass.Empty; -import grpc.testing.Messages.EchoStatus; -import grpc.testing.Messages.Payload; -import grpc.testing.Messages.ResponseParameters; -import grpc.testing.Messages.SimpleRequest; -import grpc.testing.Messages.SimpleResponse; -import grpc.testing.Messages.StreamingOutputCallResponse; -import grpc.testing.TestServiceGrpc.TestServiceImplBase; -import io.grpc.Status; -import io.grpc.stub.StreamObserver; -import java.util.logging.Logger; -import org.apache.commons.lang3.StringUtils; - -/** - * Implements the service methods defined in test.proto - */ -public class TestService extends TestServiceImplBase { - - private static final Logger LOGGER = Logger.getLogger(TestService.class.getName()); - - @Override - public void unaryCall(SimpleRequest request, StreamObserver responseObserver) { - if (request.hasResponseStatus()) { - EchoStatus echoStatus = request.getResponseStatus(); - Status status = Status.fromCodeValue(echoStatus.getCode()); - status = status.withDescription(echoStatus.getMessage()); - responseObserver.onError(status.asRuntimeException()); - return; - } - int responseSizeDesired = request.getResponseSize(); - String resp = StringUtils.repeat("0", responseSizeDesired); - Payload out = Payload.newBuilder().setBody(ByteString.copyFromUtf8(resp)).build(); - SimpleResponse response = SimpleResponse.newBuilder().setPayload(out).build(); - responseObserver.onNext(response); - responseObserver.onCompleted(); - } - - @Override - public void emptyCall(Empty request, io.grpc.stub.StreamObserver responseObserver) { - responseObserver.onNext(Empty.newBuilder().build()); - responseObserver.onCompleted(); - } - - @Override - public void streamingOutputCall(grpc.testing.Messages.StreamingOutputCallRequest request, - io.grpc.stub.StreamObserver responseObserver) { - for (ResponseParameters params: request.getResponseParametersList()) { - String str = StringUtils.repeat("0", params.getSize()); - Payload out = Payload.newBuilder().setBody(ByteString.copyFromUtf8(str)).build(); - StreamingOutputCallResponse resp = - StreamingOutputCallResponse.newBuilder().setPayload(out).build(); - responseObserver.onNext(resp); - // do we need to sleep before sending next one out - try { - if (params.getIntervalUs() >= 1000) { - Thread.sleep(params.getIntervalUs() / 1000); - } - } catch (InterruptedException e) { - e.printStackTrace(); - // TODO ignore? - } - } - responseObserver.onCompleted(); - } -} diff --git a/src/connector/src/main/java/grpc/testing/main/TestServiceAndProxy.java b/src/connector/src/main/java/grpc/testing/main/TestServiceAndProxy.java index b4e5c094..e44a40a1 100644 --- a/src/connector/src/main/java/grpc/testing/main/TestServiceAndProxy.java +++ b/src/connector/src/main/java/grpc/testing/main/TestServiceAndProxy.java @@ -5,7 +5,9 @@ import com.google.grpcweb.GrpcWebTrafficServlet; import io.grpc.Server; import io.grpc.ServerBuilder; +import io.grpc.ServerInterceptors; import java.util.EnumSet; +import java.util.concurrent.Executors; import java.util.logging.Logger; import javax.servlet.DispatcherType; import org.eclipse.jetty.servlet.ServletHandler; @@ -20,8 +22,12 @@ public class TestServiceAndProxy { private static final int GRPC_WEB_PORT = 8080; private static Server startGrpcService(int port) throws Exception { + Server grpcServer = ServerBuilder.forPort(port) - .addService(new TestService()) + .addService( + ServerInterceptors.intercept( + new TestServiceImpl(Executors.newSingleThreadScheduledExecutor()), + TestServiceImpl.interceptors())) .build(); grpcServer.start(); LOGGER.info("**** started gRPC Service on port# " + port); diff --git a/src/connector/src/main/java/grpc/testing/main/TestServiceImpl.java b/src/connector/src/main/java/grpc/testing/main/TestServiceImpl.java new file mode 100644 index 00000000..3d7e136b --- /dev/null +++ b/src/connector/src/main/java/grpc/testing/main/TestServiceImpl.java @@ -0,0 +1,535 @@ +/* + * Copyright 2020 The gRPC Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ******************* DO NOT EDIT +// This is copy of the following: +// github.com/grpc/grpc-java/blob/master/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java + +package grpc.testing.main; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Queues; +import com.google.protobuf.ByteString; +import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.internal.LogExceptionRunnable; +import io.grpc.stub.ServerCallStreamObserver; +import io.grpc.stub.StreamObserver; +import grpc.testing.EmptyProtos; +import grpc.testing.Messages; +import grpc.testing.Messages.Payload; +import grpc.testing.Messages.ResponseParameters; +import grpc.testing.Messages.SimpleRequest; +import grpc.testing.Messages.SimpleResponse; +import grpc.testing.Messages.StreamingInputCallRequest; +import grpc.testing.Messages.StreamingInputCallResponse; +import grpc.testing.Messages.StreamingOutputCallRequest; +import grpc.testing.Messages.StreamingOutputCallResponse; +import grpc.testing.TestServiceGrpc; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Queue; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.concurrent.GuardedBy; + +/** + * Implementation of the business logic for the TestService. Uses an executor to schedule chunks + * sent in response streams. + */ +public class TestServiceImpl extends TestServiceGrpc.TestServiceImplBase { + private final Random random = new Random(); + + private final ScheduledExecutorService executor; + private final ByteString compressableBuffer; + + /** + * Constructs a controller using the given executor for scheduling response stream chunks. + */ + public TestServiceImpl(ScheduledExecutorService executor) { + this.executor = executor; + this.compressableBuffer = ByteString.copyFrom(new byte[1024]); + } + + @Override + public void emptyCall(EmptyProtos.Empty request, + StreamObserver responseObserver) { + responseObserver.onNext(EmptyProtos.Empty.getDefaultInstance()); + responseObserver.onCompleted(); + } + + /** + * Immediately responds with a payload of the type and size specified in the request. + */ + @Override + public void unaryCall(SimpleRequest req, StreamObserver responseObserver) { + ServerCallStreamObserver obs = + (ServerCallStreamObserver) responseObserver; + SimpleResponse.Builder responseBuilder = SimpleResponse.newBuilder(); + try { + if (req.hasResponseCompressed() && req.getResponseCompressed().getValue()) { + obs.setCompression("gzip"); + } else { + obs.setCompression("identity"); + } + } catch (IllegalArgumentException e) { + System.out.println("sending error"); + obs.onError(Status.UNIMPLEMENTED + .withDescription("compression not supported.") + .withCause(e) + .asRuntimeException()); + return; + } + + if (req.getResponseSize() != 0) { + // For consistency with the c++ TestServiceImpl, use a random offset for unary calls. + // TODO(wonderfly): whether or not this is a good approach needs further discussion. + int offset = random.nextInt(compressableBuffer.size()); + ByteString payload = generatePayload(compressableBuffer, offset, req.getResponseSize()); + responseBuilder.setPayload( + Payload.newBuilder() + .setBody(payload)); + } + + if (req.hasResponseStatus()) { + obs.onError(Status.fromCodeValue(req.getResponseStatus().getCode()) + .withDescription(req.getResponseStatus().getMessage()) + .asRuntimeException()); + return; + } + + responseObserver.onNext(responseBuilder.build()); + responseObserver.onCompleted(); + } + + /** + * Given a request that specifies chunk size and interval between responses, creates and schedules + * the response stream. + */ + @Override + public void streamingOutputCall(StreamingOutputCallRequest request, + StreamObserver responseObserver) { + // Create and start the response dispatcher. + new ResponseDispatcher(responseObserver).enqueue(toChunkQueue(request)).completeInput(); + } + + /** + * Waits until we have received all of the request messages and then returns the aggregate payload + * size for all of the received requests. + */ + @Override + public StreamObserver streamingInputCall( + final StreamObserver responseObserver) { + return new StreamObserver() { + private int totalPayloadSize; + + @Override + public void onNext(StreamingInputCallRequest message) { + totalPayloadSize += message.getPayload().getBody().size(); + } + + @Override + public void onCompleted() { + responseObserver.onNext(StreamingInputCallResponse.newBuilder() + .setAggregatedPayloadSize(totalPayloadSize).build()); + responseObserver.onCompleted(); + } + + @Override + public void onError(Throwable cause) { + responseObserver.onError(cause); + } + }; + } + + /** + * True bi-directional streaming. Processes requests as they come in. Begins streaming results + * immediately. + */ + @Override + public StreamObserver fullDuplexCall( + final StreamObserver responseObserver) { + final ResponseDispatcher dispatcher = new ResponseDispatcher(responseObserver); + return new StreamObserver() { + @Override + public void onNext(StreamingOutputCallRequest request) { + if (request.hasResponseStatus()) { + dispatcher.cancel(); + dispatcher.onError(Status.fromCodeValue(request.getResponseStatus().getCode()) + .withDescription(request.getResponseStatus().getMessage()) + .asRuntimeException()); + return; + } + dispatcher.enqueue(toChunkQueue(request)); + } + + @Override + public void onCompleted() { + if (!dispatcher.isCancelled()) { + // Tell the dispatcher that all input has been received. + dispatcher.completeInput(); + } + } + + @Override + public void onError(Throwable cause) { + dispatcher.onError(cause); + } + }; + } + + /** + * Similar to {@link #fullDuplexCall}, except that it waits for all streaming requests to be + * received before starting the streaming responses. + */ + @Override + public StreamObserver halfDuplexCall( + final StreamObserver responseObserver) { + final ResponseDispatcher dispatcher = new ResponseDispatcher(responseObserver); + final Queue chunks = new ArrayDeque<>(); + return new StreamObserver() { + @Override + public void onNext(StreamingOutputCallRequest request) { + chunks.addAll(toChunkQueue(request)); + } + + @Override + public void onCompleted() { + // Dispatch all of the chunks in one shot. + dispatcher.enqueue(chunks).completeInput(); + } + + @Override + public void onError(Throwable cause) { + dispatcher.onError(cause); + } + }; + } + + /** + * Schedules the dispatch of a queue of chunks. Whenever chunks are added or input is completed, + * the next response chunk is scheduled for delivery to the client. When no more chunks are + * available, the stream is half-closed. + */ + private class ResponseDispatcher { + private final Chunk completionChunk = new Chunk(0, 0, 0); + private final Queue chunks; + private final StreamObserver responseStream; + private boolean scheduled; + @GuardedBy("this") private boolean cancelled; + private Throwable failure; + private Runnable dispatchTask = new Runnable() { + @Override + @SuppressWarnings("CatchAndPrintStackTrace") + public void run() { + try { + + // Dispatch the current chunk to the client. + try { + dispatchChunk(); + } catch (RuntimeException e) { + // Indicate that nothing is scheduled and re-throw. + synchronized (ResponseDispatcher.this) { + scheduled = false; + } + throw e; + } + + // Schedule the next chunk if there is one. + synchronized (ResponseDispatcher.this) { + // Indicate that nothing is scheduled. + scheduled = false; + scheduleNextChunk(); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + }; + + /** + * The {@link StreamObserver} will be used to send the queue of response chunks. Since calls to + * {@link StreamObserver} must be synchronized across threads, no further calls should be made + * directly on {@code responseStream} after it is provided to the {@link ResponseDispatcher}. + */ + public ResponseDispatcher(StreamObserver responseStream) { + this.chunks = Queues.newLinkedBlockingQueue(); + this.responseStream = responseStream; + } + + /** + * Adds the given chunks to the response stream and schedules the next chunk to be delivered if + * needed. + */ + public synchronized ResponseDispatcher enqueue(Queue moreChunks) { + assertNotFailed(); + chunks.addAll(moreChunks); + scheduleNextChunk(); + return this; + } + + /** + * Indicates that the input is completed and the currently enqueued response chunks are all that + * remain to be scheduled for dispatch to the client. + */ + public ResponseDispatcher completeInput() { + assertNotFailed(); + chunks.add(completionChunk); + scheduleNextChunk(); + return this; + } + + /** + * Allows the service to cancel the remaining responses. + */ + public synchronized void cancel() { + Preconditions.checkState(!cancelled, "Dispatcher already cancelled"); + chunks.clear(); + cancelled = true; + } + + public synchronized boolean isCancelled() { + return cancelled; + } + + private synchronized void onError(Throwable cause) { + responseStream.onError(cause); + } + + /** + * Dispatches the current response chunk to the client. This is only called by the executor. At + * any time, a given dispatch task should only be registered with the executor once. + */ + private synchronized void dispatchChunk() { + if (cancelled) { + return; + } + try { + // Pop off the next chunk and send it to the client. + Chunk chunk = chunks.remove(); + if (chunk == completionChunk) { + responseStream.onCompleted(); + } else { + responseStream.onNext(chunk.toResponse()); + } + } catch (Throwable e) { + failure = e; + if (Status.fromThrowable(e).getCode() == Status.CANCELLED.getCode()) { + // Stream was cancelled by client, responseStream.onError() might be called already or + // will be called soon by inbounding StreamObserver. + chunks.clear(); + } else { + responseStream.onError(e); + } + } + } + + /** + * Schedules the next response chunk to be dispatched. If all input has been received and there + * are no more chunks in the queue, the stream is closed. + */ + private void scheduleNextChunk() { + synchronized (this) { + if (scheduled) { + // Dispatch task is already scheduled. + return; + } + + // Schedule the next response chunk if there is one. + Chunk nextChunk = chunks.peek(); + if (nextChunk != null) { + scheduled = true; + // TODO(ejona): cancel future if RPC is cancelled + Future unused = executor.schedule(new LogExceptionRunnable(dispatchTask), + nextChunk.delayMicroseconds, TimeUnit.MICROSECONDS); + return; + } + } + } + + private void assertNotFailed() { + if (failure != null) { + throw new IllegalStateException("Stream already failed", failure); + } + } + } + + /** + * Breaks down the request and creates a queue of response chunks for the given request. + */ + public Queue toChunkQueue(StreamingOutputCallRequest request) { + Queue chunkQueue = new ArrayDeque<>(); + int offset = 0; + for (ResponseParameters params : request.getResponseParametersList()) { + chunkQueue.add(new Chunk(params.getIntervalUs(), offset, params.getSize())); + + // Increment the offset past this chunk. Buffer need to be circular. + offset = (offset + params.getSize()) % compressableBuffer.size(); + } + return chunkQueue; + } + + /** + * A single chunk of a response stream. Contains delivery information for the dispatcher and can + * be converted to a streaming response proto. A chunk just references it's payload in the + * {@link #compressableBuffer} array. The payload isn't actually created until {@link + * #toResponse()} is called. + */ + private class Chunk { + private final int delayMicroseconds; + private final int offset; + private final int length; + + public Chunk(int delayMicroseconds, int offset, int length) { + this.delayMicroseconds = delayMicroseconds; + this.offset = offset; + this.length = length; + } + + /** + * Convert this chunk into a streaming response proto. + */ + private StreamingOutputCallResponse toResponse() { + StreamingOutputCallResponse.Builder responseBuilder = + StreamingOutputCallResponse.newBuilder(); + ByteString payload = generatePayload(compressableBuffer, offset, length); + responseBuilder.setPayload( + Payload.newBuilder() + .setBody(payload)); + return responseBuilder.build(); + } + } + + /** + * Generates a payload of desired type and size. Reads compressableBuffer or + * uncompressableBuffer as a circular buffer. + */ + private ByteString generatePayload(ByteString dataBuffer, int offset, int size) { + ByteString payload = ByteString.EMPTY; + // This offset would never pass the array boundary. + int begin = offset; + int end = 0; + int bytesLeft = size; + while (bytesLeft > 0) { + end = Math.min(begin + bytesLeft, dataBuffer.size()); + // ByteString.substring returns the substring from begin, inclusive, to end, exclusive. + payload = payload.concat(dataBuffer.substring(begin, end)); + bytesLeft -= (end - begin); + begin = end % dataBuffer.size(); + } + return payload; + } + + /** Returns interceptors necessary for full service implementation. */ + public static List interceptors() { + return Arrays.asList( + echoRequestHeadersInterceptor(Util.METADATA_KEY), + echoRequestMetadataInHeaders(Util.ECHO_INITIAL_METADATA_KEY), + echoRequestMetadataInTrailers(Util.ECHO_TRAILING_METADATA_KEY)); + } + + /** + * Echo the request headers from a client into response headers and trailers. Useful for + * testing end-to-end metadata propagation. + */ + private static ServerInterceptor echoRequestHeadersInterceptor(final Metadata.Key... keys) { + final Set> keySet = new HashSet<>(Arrays.asList(keys)); + return new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall call, + final Metadata requestHeaders, + ServerCallHandler next) { + return next.startCall(new SimpleForwardingServerCall(call) { + @Override + public void sendHeaders(Metadata responseHeaders) { + responseHeaders.merge(requestHeaders, keySet); + super.sendHeaders(responseHeaders); + } + + @Override + public void close(Status status, Metadata trailers) { + trailers.merge(requestHeaders, keySet); + super.close(status, trailers); + } + }, requestHeaders); + } + }; + } + + /** + * Echoes request headers with the specified key(s) from a client into response headers only. + */ + private static ServerInterceptor echoRequestMetadataInHeaders(final Metadata.Key... keys) { + final Set> keySet = new HashSet<>(Arrays.asList(keys)); + return new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall call, + final Metadata requestHeaders, + ServerCallHandler next) { + return next.startCall(new SimpleForwardingServerCall(call) { + @Override + public void sendHeaders(Metadata responseHeaders) { + responseHeaders.merge(requestHeaders, keySet); + super.sendHeaders(responseHeaders); + } + + @Override + public void close(Status status, Metadata trailers) { + super.close(status, trailers); + } + }, requestHeaders); + } + }; + } + + /** + * Echoes request headers with the specified key(s) from a client into response trailers only. + */ + private static ServerInterceptor echoRequestMetadataInTrailers(final Metadata.Key... keys) { + final Set> keySet = new HashSet<>(Arrays.asList(keys)); + return new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall call, + final Metadata requestHeaders, + ServerCallHandler next) { + return next.startCall(new SimpleForwardingServerCall(call) { + @Override + public void sendHeaders(Metadata responseHeaders) { + super.sendHeaders(responseHeaders); + } + + @Override + public void close(Status status, Metadata trailers) { + trailers.merge(requestHeaders, keySet); + super.close(status, trailers); + } + }, requestHeaders); + } + }; + } +} diff --git a/src/connector/src/main/java/grpc/testing/main/Util.java b/src/connector/src/main/java/grpc/testing/main/Util.java new file mode 100644 index 00000000..a047429e --- /dev/null +++ b/src/connector/src/main/java/grpc/testing/main/Util.java @@ -0,0 +1,39 @@ +/* + * Copyright 2020 The gRPC Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// ******************* DO NOT EDIT +// This is copy of the following: +// github.com/grpc/grpc-java/blob/master/interop-testing/src/main/java/io/grpc/testing/integration/Util.java + +package grpc.testing.main; + +import io.grpc.Metadata; +import io.grpc.protobuf.lite.ProtoLiteUtils; +import grpc.testing.Messages; + +/** + * Utility methods to support integration testing. + */ +public class Util { + + public static final Metadata.Key METADATA_KEY = + Metadata.Key.of( + "grpc.testing.SimpleContext" + Metadata.BINARY_HEADER_SUFFIX, + ProtoLiteUtils.metadataMarshaller(Messages.SimpleContext.getDefaultInstance())); + public static final Metadata.Key ECHO_INITIAL_METADATA_KEY + = Metadata.Key.of("x-grpc-test-echo-initial", Metadata.ASCII_STRING_MARSHALLER); + public static final Metadata.Key ECHO_TRAILING_METADATA_KEY + = Metadata.Key.of("x-grpc-test-echo-trailing-bin", Metadata.BINARY_BYTE_MARSHALLER); +} diff --git a/src/connector/src/main/proto/grpc/testing/empty.proto b/src/connector/src/main/proto/grpc/testing/empty.proto index 6a0aa88d..c7584c88 100644 --- a/src/connector/src/main/proto/grpc/testing/empty.proto +++ b/src/connector/src/main/proto/grpc/testing/empty.proto @@ -1,5 +1,4 @@ - -// Copyright 2015 gRPC authors. +// Copyright 2015 The gRPC Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,10 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -syntax = "proto3"; +// ******************* DO NOT EDIT +// This is copy of the following: +// github.com/grpc/grpc-java/blob/master/interop-testing/src/main/proto/grpc/testing/empty.proto + +syntax = "proto2"; package grpc.testing; +option java_package = "grpc.testing"; +option java_outer_classname = "EmptyProtos"; + // An empty message that you can re-use to avoid defining duplicated empty // messages in your project. A typical example is to use it as argument or the // return value of a service API. For instance: diff --git a/src/connector/src/main/proto/grpc/testing/messages.proto b/src/connector/src/main/proto/grpc/testing/messages.proto index 5993bc6b..9fb45a6d 100644 --- a/src/connector/src/main/proto/grpc/testing/messages.proto +++ b/src/connector/src/main/proto/grpc/testing/messages.proto @@ -1,5 +1,4 @@ - -// Copyright 2015-2016 gRPC authors. +// Copyright 2015 The gRPC Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,28 +14,26 @@ // Message definitions to be used by integration test service definitions. +// ******************* DO NOT EDIT +// This is copy of the following: +// github.com/grpc/grpc-java/blob/master/interop-testing/src/main/proto/grpc/testing/messages.proto + syntax = "proto3"; package grpc.testing; -// TODO(dgq): Go back to using well-known types once -// https://github.com/grpc/grpc/issues/6980 has been fixed. -// import "google/protobuf/wrappers.proto"; +option java_package = "grpc.testing"; + +// TODO(jihuncho): Use well-known types once all languages are synced. message BoolValue { // The bool value. bool value = 1; } -// The type of payload that should be returned. -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; -} - // A block of data, to simply increase gRPC message size. message Payload { - // The type of data in body. - PayloadType type = 1; + reserved 1; + // Primary contents of payload. bytes body = 2; } @@ -65,9 +62,7 @@ enum GrpclbRouteType { // Unary request. message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - PayloadType response_type = 1; + reserved 1; // Desired payload size in the response from the server. int32 response_size = 2; @@ -95,9 +90,6 @@ message SimpleRequest { // Whether SimpleResponse should include server_id. bool fill_server_id = 9; - - // Whether SimpleResponse should include grpclb_route_type. - bool fill_grpclb_route_type = 10; } // Unary response, as configured by the request. @@ -109,17 +101,19 @@ message SimpleResponse { string username = 2; // OAuth scope. string oauth_scope = 3; - // Server ID. This must be unique among different server instances, // but the same across all RPC's made to a particular server instance. string server_id = 4; // gRPCLB Path. GrpclbRouteType grpclb_route_type = 5; - // Server hostname. string hostname = 6; } +message SimpleContext { + string value = 1; +} + // Client-streaming request. message StreamingInputCallRequest { // Optional input payload sent along with the request. @@ -158,11 +152,7 @@ message ResponseParameters { // Server-streaming request. message StreamingOutputCallRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - PayloadType response_type = 1; + reserved 1; // Configuration for each expected response message. repeated ResponseParameters response_parameters = 2; diff --git a/src/connector/src/main/proto/grpc/testing/test.proto b/src/connector/src/main/proto/grpc/testing/test.proto index 82c17655..c1e31ce3 100644 --- a/src/connector/src/main/proto/grpc/testing/test.proto +++ b/src/connector/src/main/proto/grpc/testing/test.proto @@ -1,5 +1,4 @@ - -// Copyright 2015-2016 gRPC authors. +// Copyright 2015 The gRPC Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,9 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. - // An integration test service that covers all the method signature permutations // of unary/streaming requests/responses. +// ******************* DO NOT EDIT +// This is copy of the following: +// github.com/grpc/grpc-java/blob/master/interop-testing/src/main/proto/grpc/testing/test.proto syntax = "proto3"; @@ -23,6 +24,8 @@ import "grpc/testing/messages.proto"; package grpc.testing; +option java_package = "grpc.testing"; + // A simple service to test the various types of RPCs and experiment with // performance with various types of payload. service TestService { @@ -74,7 +77,7 @@ service UnimplementedService { // A service used to control reconnect server. service ReconnectService { - rpc Start(grpc.testing.ReconnectParams) returns (grpc.testing.Empty); + rpc Start(grpc.testing.Empty) returns (grpc.testing.Empty); rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo); }