Interface SingleLineValue


public interface SingleLineValue
Wrapper for supporting injecting and extracting single-string values.
  • Method Details

    • get

      @Nullable String get()
      Gets the value.
      Returns:
      the value
    • set

      void set(String value)
      Sets the value.
      Parameters:
      value - the value
    • of

      static SingleLineValue of(@Nullable String value)
      Returns a SingleLineValue backed by a fixed string.
      Parameters:
      value - string value
      Returns:
      a read-only SingleLineValue
    • to

      static SingleLineValue to(Consumer<String> consumer)
      Returns a SingleLineValue which supports injection.
      Parameters:
      consumer - consumer to call when a value is injected
      Returns:
      a write-only SingleLineValue
    • format

      static String format(long traceId, long spanId, @Nullable Long parentSpanId)
      Formats the provided trace information.
      Parameters:
      traceId - the trace ID.
      spanId - the span ID.
      parentSpanId - the parent span ID, or null if none available.
      Returns:
      the formatted trace information as String.
    • format

      static String format(String traceIdHex, String spanIdHex, @Nullable String parentSpanIdHex)
      Formats the provided trace information.
      Parameters:
      traceIdHex - the trace ID as HEX String.
      spanIdHex - the span ID as HEX String.
      parentSpanIdHex - the parent span ID as HEX String, or null if none available.
      Returns:
      the formatted trace information as String.
    • format

      static String format(String traceIdHex, String spanIdHex, @Nullable String parentSpanIdHex, boolean isSampled)
      Formats the provided trace information.
      Parameters:
      traceIdHex - the trace ID as HEX String.
      spanIdHex - the span ID as HEX String.
      parentSpanIdHex - the parent span ID as HEX String, or null if none available.
      isSampled - true if the span is sampled.
      Returns:
      the formatted trace information as String.