Class TagContextTextFormat.Setter<C>

java.lang.Object
io.opencensus.tags.propagation.TagContextTextFormat.Setter<C>
Type Parameters:
C - carrier of propagation fields, such as an http request
Enclosing class:
TagContextTextFormat

public abstract static class TagContextTextFormat.Setter<C> extends Object
Class that allows a TagContextTextFormat to set propagated fields into a carrier.

Setter is stateless and allows to be saved as a constant to avoid runtime allocations.

Since:
0.21
  • Constructor Details

    • Setter

      public Setter()
  • Method Details

    • put

      public abstract void put(C carrier, String key, String value)
      Replaces a propagated field with the given value.

      For example, a setter for an HttpURLConnection would be the method reference URLConnection.addRequestProperty(String, String)

      Parameters:
      carrier - holds propagation fields. For example, an outgoing message or http request.
      key - the key of the field.
      value - the value of the field.
      Since:
      0.21