xref: /aosp_15_r20/external/grpc-grpc-java/compiler/src/testLite/golden/TestDeprecatedService.java.txt (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1*e07d83d3SAndroid Build Coastguard Workerpackage io.grpc.testing.compiler;
2*e07d83d3SAndroid Build Coastguard Worker
3*e07d83d3SAndroid Build Coastguard Workerimport static io.grpc.MethodDescriptor.generateFullMethodName;
4*e07d83d3SAndroid Build Coastguard Worker
5*e07d83d3SAndroid Build Coastguard Worker/**
6*e07d83d3SAndroid Build Coastguard Worker * <pre>
7*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
8*e07d83d3SAndroid Build Coastguard Worker * </pre>
9*e07d83d3SAndroid Build Coastguard Worker */
10*e07d83d3SAndroid Build Coastguard Worker@javax.annotation.Generated(
11*e07d83d3SAndroid Build Coastguard Worker    value = "by gRPC proto compiler (version 1.56.1-SNAPSHOT)",
12*e07d83d3SAndroid Build Coastguard Worker    comments = "Source: grpc/testing/compiler/test.proto")
13*e07d83d3SAndroid Build Coastguard Worker@io.grpc.stub.annotations.GrpcGenerated
14*e07d83d3SAndroid Build Coastguard Worker@java.lang.Deprecated
15*e07d83d3SAndroid Build Coastguard Workerpublic final class TestDeprecatedServiceGrpc {
16*e07d83d3SAndroid Build Coastguard Worker
17*e07d83d3SAndroid Build Coastguard Worker  private TestDeprecatedServiceGrpc() {}
18*e07d83d3SAndroid Build Coastguard Worker
19*e07d83d3SAndroid Build Coastguard Worker  public static final String SERVICE_NAME = "grpc.testing.compiler.TestDeprecatedService";
20*e07d83d3SAndroid Build Coastguard Worker
21*e07d83d3SAndroid Build Coastguard Worker  // Static method descriptors that strictly reflect the proto.
22*e07d83d3SAndroid Build Coastguard Worker  private static volatile io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest,
23*e07d83d3SAndroid Build Coastguard Worker      io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod;
24*e07d83d3SAndroid Build Coastguard Worker
25*e07d83d3SAndroid Build Coastguard Worker  @io.grpc.stub.annotations.RpcMethod(
26*e07d83d3SAndroid Build Coastguard Worker      fullMethodName = SERVICE_NAME + '/' + "DeprecatedMethod",
27*e07d83d3SAndroid Build Coastguard Worker      requestType = io.grpc.testing.compiler.Test.SimpleRequest.class,
28*e07d83d3SAndroid Build Coastguard Worker      responseType = io.grpc.testing.compiler.Test.SimpleResponse.class,
29*e07d83d3SAndroid Build Coastguard Worker      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
30*e07d83d3SAndroid Build Coastguard Worker  public static io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest,
31*e07d83d3SAndroid Build Coastguard Worker      io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod() {
32*e07d83d3SAndroid Build Coastguard Worker    io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest, io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod;
33*e07d83d3SAndroid Build Coastguard Worker    if ((getDeprecatedMethodMethod = TestDeprecatedServiceGrpc.getDeprecatedMethodMethod) == null) {
34*e07d83d3SAndroid Build Coastguard Worker      synchronized (TestDeprecatedServiceGrpc.class) {
35*e07d83d3SAndroid Build Coastguard Worker        if ((getDeprecatedMethodMethod = TestDeprecatedServiceGrpc.getDeprecatedMethodMethod) == null) {
36*e07d83d3SAndroid Build Coastguard Worker          TestDeprecatedServiceGrpc.getDeprecatedMethodMethod = getDeprecatedMethodMethod =
37*e07d83d3SAndroid Build Coastguard Worker              io.grpc.MethodDescriptor.<io.grpc.testing.compiler.Test.SimpleRequest, io.grpc.testing.compiler.Test.SimpleResponse>newBuilder()
38*e07d83d3SAndroid Build Coastguard Worker              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
39*e07d83d3SAndroid Build Coastguard Worker              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeprecatedMethod"))
40*e07d83d3SAndroid Build Coastguard Worker              .setSampledToLocalTracing(true)
41*e07d83d3SAndroid Build Coastguard Worker              .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
42*e07d83d3SAndroid Build Coastguard Worker                  io.grpc.testing.compiler.Test.SimpleRequest.getDefaultInstance()))
43*e07d83d3SAndroid Build Coastguard Worker              .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
44*e07d83d3SAndroid Build Coastguard Worker                  io.grpc.testing.compiler.Test.SimpleResponse.getDefaultInstance()))
45*e07d83d3SAndroid Build Coastguard Worker              .build();
46*e07d83d3SAndroid Build Coastguard Worker        }
47*e07d83d3SAndroid Build Coastguard Worker      }
48*e07d83d3SAndroid Build Coastguard Worker    }
49*e07d83d3SAndroid Build Coastguard Worker    return getDeprecatedMethodMethod;
50*e07d83d3SAndroid Build Coastguard Worker  }
51*e07d83d3SAndroid Build Coastguard Worker
52*e07d83d3SAndroid Build Coastguard Worker  /**
53*e07d83d3SAndroid Build Coastguard Worker   * Creates a new async stub that supports all call types for the service
54*e07d83d3SAndroid Build Coastguard Worker   */
55*e07d83d3SAndroid Build Coastguard Worker  public static TestDeprecatedServiceStub newStub(io.grpc.Channel channel) {
56*e07d83d3SAndroid Build Coastguard Worker    io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceStub> factory =
57*e07d83d3SAndroid Build Coastguard Worker      new io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceStub>() {
58*e07d83d3SAndroid Build Coastguard Worker        @java.lang.Override
59*e07d83d3SAndroid Build Coastguard Worker        public TestDeprecatedServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
60*e07d83d3SAndroid Build Coastguard Worker          return new TestDeprecatedServiceStub(channel, callOptions);
61*e07d83d3SAndroid Build Coastguard Worker        }
62*e07d83d3SAndroid Build Coastguard Worker      };
63*e07d83d3SAndroid Build Coastguard Worker    return TestDeprecatedServiceStub.newStub(factory, channel);
64*e07d83d3SAndroid Build Coastguard Worker  }
65*e07d83d3SAndroid Build Coastguard Worker
66*e07d83d3SAndroid Build Coastguard Worker  /**
67*e07d83d3SAndroid Build Coastguard Worker   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
68*e07d83d3SAndroid Build Coastguard Worker   */
69*e07d83d3SAndroid Build Coastguard Worker  public static TestDeprecatedServiceBlockingStub newBlockingStub(
70*e07d83d3SAndroid Build Coastguard Worker      io.grpc.Channel channel) {
71*e07d83d3SAndroid Build Coastguard Worker    io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceBlockingStub> factory =
72*e07d83d3SAndroid Build Coastguard Worker      new io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceBlockingStub>() {
73*e07d83d3SAndroid Build Coastguard Worker        @java.lang.Override
74*e07d83d3SAndroid Build Coastguard Worker        public TestDeprecatedServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
75*e07d83d3SAndroid Build Coastguard Worker          return new TestDeprecatedServiceBlockingStub(channel, callOptions);
76*e07d83d3SAndroid Build Coastguard Worker        }
77*e07d83d3SAndroid Build Coastguard Worker      };
78*e07d83d3SAndroid Build Coastguard Worker    return TestDeprecatedServiceBlockingStub.newStub(factory, channel);
79*e07d83d3SAndroid Build Coastguard Worker  }
80*e07d83d3SAndroid Build Coastguard Worker
81*e07d83d3SAndroid Build Coastguard Worker  /**
82*e07d83d3SAndroid Build Coastguard Worker   * Creates a new ListenableFuture-style stub that supports unary calls on the service
83*e07d83d3SAndroid Build Coastguard Worker   */
84*e07d83d3SAndroid Build Coastguard Worker  public static TestDeprecatedServiceFutureStub newFutureStub(
85*e07d83d3SAndroid Build Coastguard Worker      io.grpc.Channel channel) {
86*e07d83d3SAndroid Build Coastguard Worker    io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceFutureStub> factory =
87*e07d83d3SAndroid Build Coastguard Worker      new io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceFutureStub>() {
88*e07d83d3SAndroid Build Coastguard Worker        @java.lang.Override
89*e07d83d3SAndroid Build Coastguard Worker        public TestDeprecatedServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
90*e07d83d3SAndroid Build Coastguard Worker          return new TestDeprecatedServiceFutureStub(channel, callOptions);
91*e07d83d3SAndroid Build Coastguard Worker        }
92*e07d83d3SAndroid Build Coastguard Worker      };
93*e07d83d3SAndroid Build Coastguard Worker    return TestDeprecatedServiceFutureStub.newStub(factory, channel);
94*e07d83d3SAndroid Build Coastguard Worker  }
95*e07d83d3SAndroid Build Coastguard Worker
96*e07d83d3SAndroid Build Coastguard Worker  /**
97*e07d83d3SAndroid Build Coastguard Worker   * <pre>
98*e07d83d3SAndroid Build Coastguard Worker   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
99*e07d83d3SAndroid Build Coastguard Worker   * </pre>
100*e07d83d3SAndroid Build Coastguard Worker   */
101*e07d83d3SAndroid Build Coastguard Worker  @java.lang.Deprecated
102*e07d83d3SAndroid Build Coastguard Worker  public interface AsyncService {
103*e07d83d3SAndroid Build Coastguard Worker
104*e07d83d3SAndroid Build Coastguard Worker    /**
105*e07d83d3SAndroid Build Coastguard Worker     * <pre>
106*e07d83d3SAndroid Build Coastguard Worker     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
107*e07d83d3SAndroid Build Coastguard Worker     * </pre>
108*e07d83d3SAndroid Build Coastguard Worker     */
109*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Deprecated
110*e07d83d3SAndroid Build Coastguard Worker    default void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request,
111*e07d83d3SAndroid Build Coastguard Worker        io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse> responseObserver) {
112*e07d83d3SAndroid Build Coastguard Worker      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeprecatedMethodMethod(), responseObserver);
113*e07d83d3SAndroid Build Coastguard Worker    }
114*e07d83d3SAndroid Build Coastguard Worker  }
115*e07d83d3SAndroid Build Coastguard Worker
116*e07d83d3SAndroid Build Coastguard Worker  /**
117*e07d83d3SAndroid Build Coastguard Worker   * Base class for the server implementation of the service TestDeprecatedService.
118*e07d83d3SAndroid Build Coastguard Worker   * <pre>
119*e07d83d3SAndroid Build Coastguard Worker   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
120*e07d83d3SAndroid Build Coastguard Worker   * </pre>
121*e07d83d3SAndroid Build Coastguard Worker   */
122*e07d83d3SAndroid Build Coastguard Worker  @java.lang.Deprecated
123*e07d83d3SAndroid Build Coastguard Worker  public static abstract class TestDeprecatedServiceImplBase
124*e07d83d3SAndroid Build Coastguard Worker      implements io.grpc.BindableService, AsyncService {
125*e07d83d3SAndroid Build Coastguard Worker
126*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
127*e07d83d3SAndroid Build Coastguard Worker      return TestDeprecatedServiceGrpc.bindService(this);
128*e07d83d3SAndroid Build Coastguard Worker    }
129*e07d83d3SAndroid Build Coastguard Worker  }
130*e07d83d3SAndroid Build Coastguard Worker
131*e07d83d3SAndroid Build Coastguard Worker  /**
132*e07d83d3SAndroid Build Coastguard Worker   * A stub to allow clients to do asynchronous rpc calls to service TestDeprecatedService.
133*e07d83d3SAndroid Build Coastguard Worker   * <pre>
134*e07d83d3SAndroid Build Coastguard Worker   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
135*e07d83d3SAndroid Build Coastguard Worker   * </pre>
136*e07d83d3SAndroid Build Coastguard Worker   */
137*e07d83d3SAndroid Build Coastguard Worker  @java.lang.Deprecated
138*e07d83d3SAndroid Build Coastguard Worker  public static final class TestDeprecatedServiceStub
139*e07d83d3SAndroid Build Coastguard Worker      extends io.grpc.stub.AbstractAsyncStub<TestDeprecatedServiceStub> {
140*e07d83d3SAndroid Build Coastguard Worker    private TestDeprecatedServiceStub(
141*e07d83d3SAndroid Build Coastguard Worker        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
142*e07d83d3SAndroid Build Coastguard Worker      super(channel, callOptions);
143*e07d83d3SAndroid Build Coastguard Worker    }
144*e07d83d3SAndroid Build Coastguard Worker
145*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Override
146*e07d83d3SAndroid Build Coastguard Worker    protected TestDeprecatedServiceStub build(
147*e07d83d3SAndroid Build Coastguard Worker        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
148*e07d83d3SAndroid Build Coastguard Worker      return new TestDeprecatedServiceStub(channel, callOptions);
149*e07d83d3SAndroid Build Coastguard Worker    }
150*e07d83d3SAndroid Build Coastguard Worker
151*e07d83d3SAndroid Build Coastguard Worker    /**
152*e07d83d3SAndroid Build Coastguard Worker     * <pre>
153*e07d83d3SAndroid Build Coastguard Worker     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
154*e07d83d3SAndroid Build Coastguard Worker     * </pre>
155*e07d83d3SAndroid Build Coastguard Worker     */
156*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Deprecated
157*e07d83d3SAndroid Build Coastguard Worker    public void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request,
158*e07d83d3SAndroid Build Coastguard Worker        io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse> responseObserver) {
159*e07d83d3SAndroid Build Coastguard Worker      io.grpc.stub.ClientCalls.asyncUnaryCall(
160*e07d83d3SAndroid Build Coastguard Worker          getChannel().newCall(getDeprecatedMethodMethod(), getCallOptions()), request, responseObserver);
161*e07d83d3SAndroid Build Coastguard Worker    }
162*e07d83d3SAndroid Build Coastguard Worker  }
163*e07d83d3SAndroid Build Coastguard Worker
164*e07d83d3SAndroid Build Coastguard Worker  /**
165*e07d83d3SAndroid Build Coastguard Worker   * A stub to allow clients to do synchronous rpc calls to service TestDeprecatedService.
166*e07d83d3SAndroid Build Coastguard Worker   * <pre>
167*e07d83d3SAndroid Build Coastguard Worker   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
168*e07d83d3SAndroid Build Coastguard Worker   * </pre>
169*e07d83d3SAndroid Build Coastguard Worker   */
170*e07d83d3SAndroid Build Coastguard Worker  @java.lang.Deprecated
171*e07d83d3SAndroid Build Coastguard Worker  public static final class TestDeprecatedServiceBlockingStub
172*e07d83d3SAndroid Build Coastguard Worker      extends io.grpc.stub.AbstractBlockingStub<TestDeprecatedServiceBlockingStub> {
173*e07d83d3SAndroid Build Coastguard Worker    private TestDeprecatedServiceBlockingStub(
174*e07d83d3SAndroid Build Coastguard Worker        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
175*e07d83d3SAndroid Build Coastguard Worker      super(channel, callOptions);
176*e07d83d3SAndroid Build Coastguard Worker    }
177*e07d83d3SAndroid Build Coastguard Worker
178*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Override
179*e07d83d3SAndroid Build Coastguard Worker    protected TestDeprecatedServiceBlockingStub build(
180*e07d83d3SAndroid Build Coastguard Worker        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
181*e07d83d3SAndroid Build Coastguard Worker      return new TestDeprecatedServiceBlockingStub(channel, callOptions);
182*e07d83d3SAndroid Build Coastguard Worker    }
183*e07d83d3SAndroid Build Coastguard Worker
184*e07d83d3SAndroid Build Coastguard Worker    /**
185*e07d83d3SAndroid Build Coastguard Worker     * <pre>
186*e07d83d3SAndroid Build Coastguard Worker     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
187*e07d83d3SAndroid Build Coastguard Worker     * </pre>
188*e07d83d3SAndroid Build Coastguard Worker     */
189*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Deprecated
190*e07d83d3SAndroid Build Coastguard Worker    public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) {
191*e07d83d3SAndroid Build Coastguard Worker      return io.grpc.stub.ClientCalls.blockingUnaryCall(
192*e07d83d3SAndroid Build Coastguard Worker          getChannel(), getDeprecatedMethodMethod(), getCallOptions(), request);
193*e07d83d3SAndroid Build Coastguard Worker    }
194*e07d83d3SAndroid Build Coastguard Worker  }
195*e07d83d3SAndroid Build Coastguard Worker
196*e07d83d3SAndroid Build Coastguard Worker  /**
197*e07d83d3SAndroid Build Coastguard Worker   * A stub to allow clients to do ListenableFuture-style rpc calls to service TestDeprecatedService.
198*e07d83d3SAndroid Build Coastguard Worker   * <pre>
199*e07d83d3SAndroid Build Coastguard Worker   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
200*e07d83d3SAndroid Build Coastguard Worker   * </pre>
201*e07d83d3SAndroid Build Coastguard Worker   */
202*e07d83d3SAndroid Build Coastguard Worker  @java.lang.Deprecated
203*e07d83d3SAndroid Build Coastguard Worker  public static final class TestDeprecatedServiceFutureStub
204*e07d83d3SAndroid Build Coastguard Worker      extends io.grpc.stub.AbstractFutureStub<TestDeprecatedServiceFutureStub> {
205*e07d83d3SAndroid Build Coastguard Worker    private TestDeprecatedServiceFutureStub(
206*e07d83d3SAndroid Build Coastguard Worker        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
207*e07d83d3SAndroid Build Coastguard Worker      super(channel, callOptions);
208*e07d83d3SAndroid Build Coastguard Worker    }
209*e07d83d3SAndroid Build Coastguard Worker
210*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Override
211*e07d83d3SAndroid Build Coastguard Worker    protected TestDeprecatedServiceFutureStub build(
212*e07d83d3SAndroid Build Coastguard Worker        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
213*e07d83d3SAndroid Build Coastguard Worker      return new TestDeprecatedServiceFutureStub(channel, callOptions);
214*e07d83d3SAndroid Build Coastguard Worker    }
215*e07d83d3SAndroid Build Coastguard Worker
216*e07d83d3SAndroid Build Coastguard Worker    /**
217*e07d83d3SAndroid Build Coastguard Worker     * <pre>
218*e07d83d3SAndroid Build Coastguard Worker     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
219*e07d83d3SAndroid Build Coastguard Worker     * </pre>
220*e07d83d3SAndroid Build Coastguard Worker     */
221*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Deprecated
222*e07d83d3SAndroid Build Coastguard Worker    public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.compiler.Test.SimpleResponse> deprecatedMethod(
223*e07d83d3SAndroid Build Coastguard Worker        io.grpc.testing.compiler.Test.SimpleRequest request) {
224*e07d83d3SAndroid Build Coastguard Worker      return io.grpc.stub.ClientCalls.futureUnaryCall(
225*e07d83d3SAndroid Build Coastguard Worker          getChannel().newCall(getDeprecatedMethodMethod(), getCallOptions()), request);
226*e07d83d3SAndroid Build Coastguard Worker    }
227*e07d83d3SAndroid Build Coastguard Worker  }
228*e07d83d3SAndroid Build Coastguard Worker
229*e07d83d3SAndroid Build Coastguard Worker  private static final int METHODID_DEPRECATED_METHOD = 0;
230*e07d83d3SAndroid Build Coastguard Worker
231*e07d83d3SAndroid Build Coastguard Worker  private static final class MethodHandlers<Req, Resp> implements
232*e07d83d3SAndroid Build Coastguard Worker      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
233*e07d83d3SAndroid Build Coastguard Worker      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
234*e07d83d3SAndroid Build Coastguard Worker      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
235*e07d83d3SAndroid Build Coastguard Worker      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
236*e07d83d3SAndroid Build Coastguard Worker    private final AsyncService serviceImpl;
237*e07d83d3SAndroid Build Coastguard Worker    private final int methodId;
238*e07d83d3SAndroid Build Coastguard Worker
239*e07d83d3SAndroid Build Coastguard Worker    MethodHandlers(AsyncService serviceImpl, int methodId) {
240*e07d83d3SAndroid Build Coastguard Worker      this.serviceImpl = serviceImpl;
241*e07d83d3SAndroid Build Coastguard Worker      this.methodId = methodId;
242*e07d83d3SAndroid Build Coastguard Worker    }
243*e07d83d3SAndroid Build Coastguard Worker
244*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Override
245*e07d83d3SAndroid Build Coastguard Worker    @java.lang.SuppressWarnings("unchecked")
246*e07d83d3SAndroid Build Coastguard Worker    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
247*e07d83d3SAndroid Build Coastguard Worker      switch (methodId) {
248*e07d83d3SAndroid Build Coastguard Worker        case METHODID_DEPRECATED_METHOD:
249*e07d83d3SAndroid Build Coastguard Worker          serviceImpl.deprecatedMethod((io.grpc.testing.compiler.Test.SimpleRequest) request,
250*e07d83d3SAndroid Build Coastguard Worker              (io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse>) responseObserver);
251*e07d83d3SAndroid Build Coastguard Worker          break;
252*e07d83d3SAndroid Build Coastguard Worker        default:
253*e07d83d3SAndroid Build Coastguard Worker          throw new AssertionError();
254*e07d83d3SAndroid Build Coastguard Worker      }
255*e07d83d3SAndroid Build Coastguard Worker    }
256*e07d83d3SAndroid Build Coastguard Worker
257*e07d83d3SAndroid Build Coastguard Worker    @java.lang.Override
258*e07d83d3SAndroid Build Coastguard Worker    @java.lang.SuppressWarnings("unchecked")
259*e07d83d3SAndroid Build Coastguard Worker    public io.grpc.stub.StreamObserver<Req> invoke(
260*e07d83d3SAndroid Build Coastguard Worker        io.grpc.stub.StreamObserver<Resp> responseObserver) {
261*e07d83d3SAndroid Build Coastguard Worker      switch (methodId) {
262*e07d83d3SAndroid Build Coastguard Worker        default:
263*e07d83d3SAndroid Build Coastguard Worker          throw new AssertionError();
264*e07d83d3SAndroid Build Coastguard Worker      }
265*e07d83d3SAndroid Build Coastguard Worker    }
266*e07d83d3SAndroid Build Coastguard Worker  }
267*e07d83d3SAndroid Build Coastguard Worker
268*e07d83d3SAndroid Build Coastguard Worker  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
269*e07d83d3SAndroid Build Coastguard Worker    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
270*e07d83d3SAndroid Build Coastguard Worker        .addMethod(
271*e07d83d3SAndroid Build Coastguard Worker          getDeprecatedMethodMethod(),
272*e07d83d3SAndroid Build Coastguard Worker          io.grpc.stub.ServerCalls.asyncUnaryCall(
273*e07d83d3SAndroid Build Coastguard Worker            new MethodHandlers<
274*e07d83d3SAndroid Build Coastguard Worker              io.grpc.testing.compiler.Test.SimpleRequest,
275*e07d83d3SAndroid Build Coastguard Worker              io.grpc.testing.compiler.Test.SimpleResponse>(
276*e07d83d3SAndroid Build Coastguard Worker                service, METHODID_DEPRECATED_METHOD)))
277*e07d83d3SAndroid Build Coastguard Worker        .build();
278*e07d83d3SAndroid Build Coastguard Worker  }
279*e07d83d3SAndroid Build Coastguard Worker
280*e07d83d3SAndroid Build Coastguard Worker  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
281*e07d83d3SAndroid Build Coastguard Worker
282*e07d83d3SAndroid Build Coastguard Worker  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
283*e07d83d3SAndroid Build Coastguard Worker    io.grpc.ServiceDescriptor result = serviceDescriptor;
284*e07d83d3SAndroid Build Coastguard Worker    if (result == null) {
285*e07d83d3SAndroid Build Coastguard Worker      synchronized (TestDeprecatedServiceGrpc.class) {
286*e07d83d3SAndroid Build Coastguard Worker        result = serviceDescriptor;
287*e07d83d3SAndroid Build Coastguard Worker        if (result == null) {
288*e07d83d3SAndroid Build Coastguard Worker          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
289*e07d83d3SAndroid Build Coastguard Worker              .addMethod(getDeprecatedMethodMethod())
290*e07d83d3SAndroid Build Coastguard Worker              .build();
291*e07d83d3SAndroid Build Coastguard Worker        }
292*e07d83d3SAndroid Build Coastguard Worker      }
293*e07d83d3SAndroid Build Coastguard Worker    }
294*e07d83d3SAndroid Build Coastguard Worker    return result;
295*e07d83d3SAndroid Build Coastguard Worker  }
296*e07d83d3SAndroid Build Coastguard Worker}
297