Class KeyValue.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<KeyValue,KeyValue.Builder>
io.opentelemetry.proto.common.v1.KeyValue.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, KeyValueOrBuilder, Cloneable
Enclosing class:
KeyValue

public static final class KeyValue.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<KeyValue,KeyValue.Builder> implements KeyValueOrBuilder
 Represents a key-value pair that is used to store Span attributes, Link
 attributes, etc.
 
Protobuf type opentelemetry.proto.common.v1.KeyValue
  • Method Details

    • getKey

      public String getKey()
       The key name of the pair.
       
      string key = 1 [json_name = "key"];
      Specified by:
      getKey in interface KeyValueOrBuilder
      Returns:
      The key.
    • getKeyBytes

      public com.google.protobuf.ByteString getKeyBytes()
       The key name of the pair.
       
      string key = 1 [json_name = "key"];
      Specified by:
      getKeyBytes in interface KeyValueOrBuilder
      Returns:
      The bytes for key.
    • setKey

      public KeyValue.Builder setKey(String value)
       The key name of the pair.
       
      string key = 1 [json_name = "key"];
      Parameters:
      value - The key to set.
      Returns:
      This builder for chaining.
    • clearKey

      public KeyValue.Builder clearKey()
       The key name of the pair.
       
      string key = 1 [json_name = "key"];
      Returns:
      This builder for chaining.
    • setKeyBytes

      public KeyValue.Builder setKeyBytes(com.google.protobuf.ByteString value)
       The key name of the pair.
       
      string key = 1 [json_name = "key"];
      Parameters:
      value - The bytes for key to set.
      Returns:
      This builder for chaining.
    • hasValue

      public boolean hasValue()
       The value of the pair.
       
      .opentelemetry.proto.common.v1.AnyValue value = 2 [json_name = "value"];
      Specified by:
      hasValue in interface KeyValueOrBuilder
      Returns:
      Whether the value field is set.
    • getValue

      public AnyValue getValue()
       The value of the pair.
       
      .opentelemetry.proto.common.v1.AnyValue value = 2 [json_name = "value"];
      Specified by:
      getValue in interface KeyValueOrBuilder
      Returns:
      The value.
    • setValue

      public KeyValue.Builder setValue(AnyValue value)
       The value of the pair.
       
      .opentelemetry.proto.common.v1.AnyValue value = 2 [json_name = "value"];
    • setValue

      public KeyValue.Builder setValue(AnyValue.Builder builderForValue)
       The value of the pair.
       
      .opentelemetry.proto.common.v1.AnyValue value = 2 [json_name = "value"];
    • mergeValue

      public KeyValue.Builder mergeValue(AnyValue value)
       The value of the pair.
       
      .opentelemetry.proto.common.v1.AnyValue value = 2 [json_name = "value"];
    • clearValue

      public KeyValue.Builder clearValue()
       The value of the pair.
       
      .opentelemetry.proto.common.v1.AnyValue value = 2 [json_name = "value"];