All Downloads are FREE. Search and download functionalities are using the official Maven repository.

arthas.grpc.unittest.ArthasUnittestServiceGrpc Maven / Gradle / Ivy

The newest version!
package arthas.grpc.unittest;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.28.0)",
    comments = "Source: arthasUnittest.proto")
public final class ArthasUnittestServiceGrpc {

  private ArthasUnittestServiceGrpc() {}

  public static final String SERVICE_NAME = "arthas.grpc.unittest.ArthasUnittestService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor getUnaryMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "unary",
      requestType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.class,
      responseType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getUnaryMethod() {
    io.grpc.MethodDescriptor getUnaryMethod;
    if ((getUnaryMethod = ArthasUnittestServiceGrpc.getUnaryMethod) == null) {
      synchronized (ArthasUnittestServiceGrpc.class) {
        if ((getUnaryMethod = ArthasUnittestServiceGrpc.getUnaryMethod) == null) {
          ArthasUnittestServiceGrpc.getUnaryMethod = getUnaryMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "unary"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ArthasUnittestServiceMethodDescriptorSupplier("unary"))
              .build();
        }
      }
    }
    return getUnaryMethod;
  }

  private static volatile io.grpc.MethodDescriptor getUnaryAddSumMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "unaryAddSum",
      requestType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.class,
      responseType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getUnaryAddSumMethod() {
    io.grpc.MethodDescriptor getUnaryAddSumMethod;
    if ((getUnaryAddSumMethod = ArthasUnittestServiceGrpc.getUnaryAddSumMethod) == null) {
      synchronized (ArthasUnittestServiceGrpc.class) {
        if ((getUnaryAddSumMethod = ArthasUnittestServiceGrpc.getUnaryAddSumMethod) == null) {
          ArthasUnittestServiceGrpc.getUnaryAddSumMethod = getUnaryAddSumMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "unaryAddSum"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ArthasUnittestServiceMethodDescriptorSupplier("unaryAddSum"))
              .build();
        }
      }
    }
    return getUnaryAddSumMethod;
  }

  private static volatile io.grpc.MethodDescriptor getUnaryGetSumMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "unaryGetSum",
      requestType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.class,
      responseType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getUnaryGetSumMethod() {
    io.grpc.MethodDescriptor getUnaryGetSumMethod;
    if ((getUnaryGetSumMethod = ArthasUnittestServiceGrpc.getUnaryGetSumMethod) == null) {
      synchronized (ArthasUnittestServiceGrpc.class) {
        if ((getUnaryGetSumMethod = ArthasUnittestServiceGrpc.getUnaryGetSumMethod) == null) {
          ArthasUnittestServiceGrpc.getUnaryGetSumMethod = getUnaryGetSumMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "unaryGetSum"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ArthasUnittestServiceMethodDescriptorSupplier("unaryGetSum"))
              .build();
        }
      }
    }
    return getUnaryGetSumMethod;
  }

  private static volatile io.grpc.MethodDescriptor getClientStreamSumMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "clientStreamSum",
      requestType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.class,
      responseType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor getClientStreamSumMethod() {
    io.grpc.MethodDescriptor getClientStreamSumMethod;
    if ((getClientStreamSumMethod = ArthasUnittestServiceGrpc.getClientStreamSumMethod) == null) {
      synchronized (ArthasUnittestServiceGrpc.class) {
        if ((getClientStreamSumMethod = ArthasUnittestServiceGrpc.getClientStreamSumMethod) == null) {
          ArthasUnittestServiceGrpc.getClientStreamSumMethod = getClientStreamSumMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "clientStreamSum"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ArthasUnittestServiceMethodDescriptorSupplier("clientStreamSum"))
              .build();
        }
      }
    }
    return getClientStreamSumMethod;
  }

  private static volatile io.grpc.MethodDescriptor getServerStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "serverStream",
      requestType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.class,
      responseType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor getServerStreamMethod() {
    io.grpc.MethodDescriptor getServerStreamMethod;
    if ((getServerStreamMethod = ArthasUnittestServiceGrpc.getServerStreamMethod) == null) {
      synchronized (ArthasUnittestServiceGrpc.class) {
        if ((getServerStreamMethod = ArthasUnittestServiceGrpc.getServerStreamMethod) == null) {
          ArthasUnittestServiceGrpc.getServerStreamMethod = getServerStreamMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "serverStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ArthasUnittestServiceMethodDescriptorSupplier("serverStream"))
              .build();
        }
      }
    }
    return getServerStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor getBiStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "biStream",
      requestType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.class,
      responseType = arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor getBiStreamMethod() {
    io.grpc.MethodDescriptor getBiStreamMethod;
    if ((getBiStreamMethod = ArthasUnittestServiceGrpc.getBiStreamMethod) == null) {
      synchronized (ArthasUnittestServiceGrpc.class) {
        if ((getBiStreamMethod = ArthasUnittestServiceGrpc.getBiStreamMethod) == null) {
          ArthasUnittestServiceGrpc.getBiStreamMethod = getBiStreamMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "biStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new ArthasUnittestServiceMethodDescriptorSupplier("biStream"))
              .build();
        }
      }
    }
    return getBiStreamMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static ArthasUnittestServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public ArthasUnittestServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new ArthasUnittestServiceStub(channel, callOptions);
        }
      };
    return ArthasUnittestServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static ArthasUnittestServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public ArthasUnittestServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new ArthasUnittestServiceBlockingStub(channel, callOptions);
        }
      };
    return ArthasUnittestServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static ArthasUnittestServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public ArthasUnittestServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new ArthasUnittestServiceFutureStub(channel, callOptions);
        }
      };
    return ArthasUnittestServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class ArthasUnittestServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void unary(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getUnaryMethod(), responseObserver);
    }

    /**
     */
    public void unaryAddSum(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getUnaryAddSumMethod(), responseObserver);
    }

    /**
     */
    public void unaryGetSum(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getUnaryGetSumMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver clientStreamSum(
        io.grpc.stub.StreamObserver responseObserver) {
      return asyncUnimplementedStreamingCall(getClientStreamSumMethod(), responseObserver);
    }

    /**
     */
    public void serverStream(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getServerStreamMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver biStream(
        io.grpc.stub.StreamObserver responseObserver) {
      return asyncUnimplementedStreamingCall(getBiStreamMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getUnaryMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest,
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse>(
                  this, METHODID_UNARY)))
          .addMethod(
            getUnaryAddSumMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest,
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse>(
                  this, METHODID_UNARY_ADD_SUM)))
          .addMethod(
            getUnaryGetSumMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest,
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse>(
                  this, METHODID_UNARY_GET_SUM)))
          .addMethod(
            getClientStreamSumMethod(),
            asyncClientStreamingCall(
              new MethodHandlers<
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest,
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse>(
                  this, METHODID_CLIENT_STREAM_SUM)))
          .addMethod(
            getServerStreamMethod(),
            asyncServerStreamingCall(
              new MethodHandlers<
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest,
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse>(
                  this, METHODID_SERVER_STREAM)))
          .addMethod(
            getBiStreamMethod(),
            asyncBidiStreamingCall(
              new MethodHandlers<
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest,
                arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse>(
                  this, METHODID_BI_STREAM)))
          .build();
    }
  }

  /**
   */
  public static final class ArthasUnittestServiceStub extends io.grpc.stub.AbstractAsyncStub {
    private ArthasUnittestServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected ArthasUnittestServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new ArthasUnittestServiceStub(channel, callOptions);
    }

    /**
     */
    public void unary(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getUnaryMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void unaryAddSum(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getUnaryAddSumMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void unaryGetSum(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getUnaryGetSumMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver clientStreamSum(
        io.grpc.stub.StreamObserver responseObserver) {
      return asyncClientStreamingCall(
          getChannel().newCall(getClientStreamSumMethod(), getCallOptions()), responseObserver);
    }

    /**
     */
    public void serverStream(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncServerStreamingCall(
          getChannel().newCall(getServerStreamMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver biStream(
        io.grpc.stub.StreamObserver responseObserver) {
      return asyncBidiStreamingCall(
          getChannel().newCall(getBiStreamMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   */
  public static final class ArthasUnittestServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
    private ArthasUnittestServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected ArthasUnittestServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new ArthasUnittestServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse unary(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return blockingUnaryCall(
          getChannel(), getUnaryMethod(), getCallOptions(), request);
    }

    /**
     */
    public arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse unaryAddSum(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return blockingUnaryCall(
          getChannel(), getUnaryAddSumMethod(), getCallOptions(), request);
    }

    /**
     */
    public arthas.grpc.unittest.ArthasUnittest.ArthasUnittestResponse unaryGetSum(arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return blockingUnaryCall(
          getChannel(), getUnaryGetSumMethod(), getCallOptions(), request);
    }

    /**
     */
    public java.util.Iterator serverStream(
        arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return blockingServerStreamingCall(
          getChannel(), getServerStreamMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class ArthasUnittestServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
    private ArthasUnittestServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected ArthasUnittestServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new ArthasUnittestServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture unary(
        arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getUnaryMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture unaryAddSum(
        arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getUnaryAddSumMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture unaryGetSum(
        arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getUnaryGetSumMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_UNARY = 0;
  private static final int METHODID_UNARY_ADD_SUM = 1;
  private static final int METHODID_UNARY_GET_SUM = 2;
  private static final int METHODID_SERVER_STREAM = 3;
  private static final int METHODID_CLIENT_STREAM_SUM = 4;
  private static final int METHODID_BI_STREAM = 5;

  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 ArthasUnittestServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(ArthasUnittestServiceImplBase 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_UNARY:
          serviceImpl.unary((arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_UNARY_ADD_SUM:
          serviceImpl.unaryAddSum((arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_UNARY_GET_SUM:
          serviceImpl.unaryGetSum((arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_SERVER_STREAM:
          serviceImpl.serverStream((arthas.grpc.unittest.ArthasUnittest.ArthasUnittestRequest) 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_CLIENT_STREAM_SUM:
          return (io.grpc.stub.StreamObserver) serviceImpl.clientStreamSum(
              (io.grpc.stub.StreamObserver) responseObserver);
        case METHODID_BI_STREAM:
          return (io.grpc.stub.StreamObserver) serviceImpl.biStream(
              (io.grpc.stub.StreamObserver) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class ArthasUnittestServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    ArthasUnittestServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return arthas.grpc.unittest.ArthasUnittest.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("ArthasUnittestService");
    }
  }

  private static final class ArthasUnittestServiceFileDescriptorSupplier
      extends ArthasUnittestServiceBaseDescriptorSupplier {
    ArthasUnittestServiceFileDescriptorSupplier() {}
  }

  private static final class ArthasUnittestServiceMethodDescriptorSupplier
      extends ArthasUnittestServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    ArthasUnittestServiceMethodDescriptorSupplier(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 (ArthasUnittestServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new ArthasUnittestServiceFileDescriptorSupplier())
              .addMethod(getUnaryMethod())
              .addMethod(getUnaryAddSumMethod())
              .addMethod(getUnaryGetSumMethod())
              .addMethod(getClientStreamSumMethod())
              .addMethod(getServerStreamMethod())
              .addMethod(getBiStreamMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy