what-the-bank/sources/io/grpc/ServerMethodDefinition.java

29 lines
1.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package io.grpc;
/* loaded from: classes6.dex */
public final class ServerMethodDefinition<ReqT, RespT> {
private final ServerCallHandler<ReqT, RespT> handler;
private final MethodDescriptor<ReqT, RespT> method;
private ServerMethodDefinition(MethodDescriptor<ReqT, RespT> methodDescriptor, ServerCallHandler<ReqT, RespT> serverCallHandler) {
this.method = methodDescriptor;
this.handler = serverCallHandler;
}
public static <ReqT, RespT> ServerMethodDefinition<ReqT, RespT> create(MethodDescriptor<ReqT, RespT> methodDescriptor, ServerCallHandler<ReqT, RespT> serverCallHandler) {
return new ServerMethodDefinition<>(methodDescriptor, serverCallHandler);
}
public final ServerMethodDefinition<ReqT, RespT> withServerCallHandler(ServerCallHandler<ReqT, RespT> serverCallHandler) {
return new ServerMethodDefinition<>(this.method, serverCallHandler);
}
public final ServerCallHandler<ReqT, RespT> getServerCallHandler() {
return this.handler;
}
public final MethodDescriptor<ReqT, RespT> getMethodDescriptor() {
return this.method;
}
}