Interface Body


@Immutable @Deprecated public interface Body
Deprecated.
This represents all the possible values for a log message body. A Body can currently only have 1 type of values: String, represented through Body.Type. This class will likely be extended in the future to include additional body types supported by the OpenTelemetry log data model.
Since:
1.27.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Deprecated.
    Use Value.getType().
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Returns the String value of this Body.
    static Body
    Deprecated.
    Return an empty Body.
    Deprecated.
    Use Value.getType().
    static Body
    string(String stringValue)
    Deprecated.
    Returns an Body with a string value.
  • Method Details

    • string

      static Body string(String stringValue)
      Deprecated.
      Returns an Body with a string value.
      Parameters:
      stringValue - The new value.
      Returns:
      a Body with a string value.
    • empty

      static Body empty()
      Deprecated.
      Return an empty Body.
      Returns:
      a Body without a value.
    • asString

      String asString()
      Deprecated.
      Returns the String value of this Body.

      If the log record body is some ValueType other than ValueType.STRING, this returns Value.asString(). Consumers should use LogRecordData.getBodyValue() instead.

    • getType

      Deprecated.
      Use Value.getType().
      Returns the type of the Body.