package io.grpc.stub; import com.google.common.base.Preconditions; import io.grpc.CallCredentials; import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientInterceptor; import io.grpc.ClientInterceptors; import io.grpc.Deadline; import io.grpc.stub.AbstractStub; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; /* loaded from: classes6.dex */ public abstract class AbstractStub> { private final CallOptions callOptions; private final Channel channel; /* loaded from: classes6.dex */ public interface StubFactory> { T newStub(Channel channel, CallOptions callOptions); } protected abstract S build(Channel channel, CallOptions callOptions); protected AbstractStub(Channel channel) { this(channel, CallOptions.DEFAULT); } /* JADX INFO: Access modifiers changed from: protected */ public AbstractStub(Channel channel, CallOptions callOptions) { this.channel = (Channel) Preconditions.checkNotNull(channel, "channel"); this.callOptions = (CallOptions) Preconditions.checkNotNull(callOptions, "callOptions"); } public static > T newStub(StubFactory stubFactory, Channel channel) { return (T) newStub(stubFactory, channel, CallOptions.DEFAULT); } public static > T newStub(StubFactory stubFactory, Channel channel, CallOptions callOptions) { return stubFactory.newStub(channel, callOptions); } public final S withDeadline(Deadline deadline) { return build(this.channel, this.callOptions.withDeadline(deadline)); } public final S withDeadlineAfter(long j, TimeUnit timeUnit) { return build(this.channel, this.callOptions.withDeadlineAfter(j, timeUnit)); } public final S withExecutor(Executor executor) { return build(this.channel, this.callOptions.withExecutor(executor)); } public final S withCompression(String str) { return build(this.channel, this.callOptions.withCompression(str)); } @Deprecated public final S withChannel(Channel channel) { return build(channel, this.callOptions); } public final S withOption(CallOptions.Key key, T t) { return build(this.channel, this.callOptions.withOption(key, t)); } public final S withInterceptors(ClientInterceptor... clientInterceptorArr) { return build(ClientInterceptors.intercept(this.channel, clientInterceptorArr), this.callOptions); } public final S withCallCredentials(CallCredentials callCredentials) { return build(this.channel, this.callOptions.withCallCredentials(callCredentials)); } public final S withWaitForReady() { return build(this.channel, this.callOptions.withWaitForReady()); } public final S withMaxInboundMessageSize(int i) { return build(this.channel, this.callOptions.withMaxInboundMessageSize(i)); } public final S withMaxOutboundMessageSize(int i) { return build(this.channel, this.callOptions.withMaxOutboundMessageSize(i)); } public final Channel getChannel() { return this.channel; } public final CallOptions getCallOptions() { return this.callOptions; } }