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

org.apache.rocketmq.shaded.io.opentelemetry.context.propagation.NoopTextMapPropagator Maven / Gradle / Ivy

There is a newer version: 5.0.7
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.apache.rocketmq.shaded.io.opentelemetry.context.propagation;

import org.apache.rocketmq.shaded.io.opentelemetry.context.Context;
import java.util.Collection;
import java.util.Collections;
import javax.annotation.Nullable;

final class NoopTextMapPropagator implements TextMapPropagator {
  private static final NoopTextMapPropagator INSTANCE = new NoopTextMapPropagator();

  static TextMapPropagator getInstance() {
    return INSTANCE;
  }

  @Override
  public Collection fields() {
    return Collections.emptyList();
  }

  @Override
  public  void inject(Context context, @Nullable C carrier, TextMapSetter setter) {}

  @Override
  public  Context extract(Context context, @Nullable C carrier, TextMapGetter getter) {
    if (context == null) {
      return Context.root();
    }
    return context;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy