Class ImmutableBaggage.Builder

java.lang.Object
io.opentelemetry.api.baggage.ImmutableBaggage.Builder
All Implemented Interfaces:
BaggageBuilder
Enclosing class:
ImmutableBaggage

static class ImmutableBaggage.Builder extends Object implements BaggageBuilder
  • Field Details

  • Constructor Details

    • Builder

      Builder()
    • Builder

      Builder(List<Object> data)
  • Method Details

    • put

      public BaggageBuilder put(String key, String value, BaggageEntryMetadata entryMetadata)
      Description copied from interface: BaggageBuilder
      Adds the key/value pair and metadata regardless of whether the key is present.
      Specified by:
      put in interface BaggageBuilder
      Parameters:
      key - the String key which will be set.
      value - the String value to set for the given key.
      entryMetadata - the BaggageEntryMetadata metadata to set for the given key.
      Returns:
      this
    • remove

      public BaggageBuilder remove(String key)
      Description copied from interface: BaggageBuilder
      Removes the key if it exists.
      Specified by:
      remove in interface BaggageBuilder
      Parameters:
      key - the String key which will be removed.
      Returns:
      this
    • build

      public Baggage build()
      Description copied from interface: BaggageBuilder
      Creates a Baggage from this builder.
      Specified by:
      build in interface BaggageBuilder
      Returns:
      a Baggage with the same entries as this builder.