diff --git a/stub/src/main/java/io/grpc/stub/MetadataUtils.java b/stub/src/main/java/io/grpc/stub/MetadataUtils.java index 5395ba9b5e3..addf54c0f81 100644 --- a/stub/src/main/java/io/grpc/stub/MetadataUtils.java +++ b/stub/src/main/java/io/grpc/stub/MetadataUtils.java @@ -18,12 +18,10 @@ import static com.google.common.base.Preconditions.checkNotNull; -import com.google.errorprone.annotations.InlineMe; import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; import io.grpc.ClientInterceptor; -import io.grpc.ExperimentalApi; import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; import io.grpc.Metadata; @@ -38,24 +36,6 @@ public final class MetadataUtils { // Prevent instantiation private MetadataUtils() {} - /** - * Attaches a set of request headers to a stub. - * - * @param stub to bind the headers to. - * @param extraHeaders the headers to be passed by each call on the returned stub. - * @return an implementation of the stub with {@code extraHeaders} bound to each call. - * @deprecated Use {@code stub.withInterceptors(newAttachHeadersInterceptor(...))} instead. - */ - @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1789") - @Deprecated - @InlineMe( - replacement = - "stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(extraHeaders))", - imports = "io.grpc.stub.MetadataUtils") - public static > T attachHeaders(T stub, Metadata extraHeaders) { - return stub.withInterceptors(newAttachHeadersInterceptor(extraHeaders)); - } - /** * Returns a client interceptor that attaches a set of headers to requests. * @@ -97,31 +77,6 @@ public void start(Listener responseListener, Metadata headers) { } } - /** - * Captures the last received metadata for a stub. Useful for testing - * - * @param stub to capture for - * @param headersCapture to record the last received headers - * @param trailersCapture to record the last received trailers - * @return an implementation of the stub that allows to access the last received call's - * headers and trailers via {@code headersCapture} and {@code trailersCapture}. - * @deprecated Use {@code stub.withInterceptors(newCaptureMetadataInterceptor())} instead. - */ - @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1789") - @Deprecated - @InlineMe( - replacement = - "stub.withInterceptors(MetadataUtils.newCaptureMetadataInterceptor(headersCapture," - + " trailersCapture))", - imports = "io.grpc.stub.MetadataUtils") - public static > T captureMetadata( - T stub, - AtomicReference headersCapture, - AtomicReference trailersCapture) { - return stub.withInterceptors( - newCaptureMetadataInterceptor(headersCapture, trailersCapture)); - } - /** * Captures the last received metadata on a channel. Useful for testing. *