/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.instrumentation.grpc.v1_5.client;

import io.grpc.Metadata;
import io.opentelemetry.context.propagation.TextMapPropagator;

final class GrpcInjectAdapter implements TextMapPropagator.Setter<Metadata> {

  static final GrpcInjectAdapter SETTER = new GrpcInjectAdapter();

  @Override
  public void set(Metadata carrier, String key, String value) {
    carrier.put(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER), value);
  }
}
