Class 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 java.lang.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 Summary

      Constructors 
      Constructor Description
      Setter()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract void put​(C carrier, java.lang.String key, java.lang.String value)
      Replaces a propagated field with the given value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Setter

        public Setter()
    • Method Detail

      • put

        public abstract void put​(C carrier,
                                 java.lang.String key,
                                 java.lang.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