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

io.opentelemetry.context.propagation.TextMapGetter Maven / Gradle / Ivy

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

package io.opentelemetry.context.propagation;

import javax.annotation.Nullable;

/**
 * Interface that allows a {@code TextMapPropagator} to read propagated fields from a carrier.
 *
 * 

{@code Getter} is stateless and allows to be saved as a constant to avoid runtime allocations. * * @param carrier of propagation fields, such as an http request. */ public interface TextMapGetter { /** * Returns all the keys in the given carrier. * * @param carrier carrier of propagation fields, such as an http request. * @since 0.10.0 */ Iterable keys(C carrier); /** * Returns the first value of the given propagation {@code key} or returns {@code null}. * * @param carrier carrier of propagation fields, such as an http request. * @param key the key of the field. * @return the first value of the given propagation {@code key} or returns {@code null}. */ @Nullable String get(@Nullable C carrier, String key); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy