Package io.opentelemetry.api.common
Class KeyValueList
- java.lang.Object
-
- io.opentelemetry.api.common.KeyValueList
-
-
Constructor Summary
Constructors Modifier Constructor Description private
KeyValueList(java.util.List<KeyValue> value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
Return a string encoding of thisValue
.(package private) static Value<java.util.List<KeyValue>>
create(KeyValue... value)
(package private) static Value<java.util.List<KeyValue>>
createFromMap(java.util.Map<java.lang.String,Value<?>> value)
boolean
equals(java.lang.Object o)
ValueType
getType()
Returns the type of thisValue
.java.util.List<KeyValue>
getValue()
Returns the value for thisValue
.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
value
private final java.util.List<KeyValue> value
-
-
Constructor Detail
-
KeyValueList
private KeyValueList(java.util.List<KeyValue> value)
-
-
Method Detail
-
createFromMap
static Value<java.util.List<KeyValue>> createFromMap(java.util.Map<java.lang.String,Value<?>> value)
-
getType
public ValueType getType()
Description copied from interface:Value
Returns the type of thisValue
. Useful for building switch statements.
-
getValue
public java.util.List<KeyValue> getValue()
Description copied from interface:Value
Returns the value for thisValue
.The return type varies by
Value.getType()
as described below:ValueType.STRING
returnsString
ValueType.BOOLEAN
returnsboolean
ValueType.LONG
returnslong
ValueType.DOUBLE
returnsdouble
ValueType.ARRAY
returnsList
ofValue
ValueType.KEY_VALUE_LIST
returnsList
ofKeyValue
ValueType.BYTES
returns read onlyByteBuffer
. SeeByteBuffer.asReadOnlyBuffer()
.
-
asString
public java.lang.String asString()
Description copied from interface:Value
Return a string encoding of thisValue
. This is intended to be a fallback serialized representation in case there is no suitable encoding that can utilizeValue.getType()
/Value.getValue()
to serialize specific types.WARNING: No guarantees are made about the encoding of this string response. It MAY change in a future minor release. If you need a reliable string encoding, write your own serializer.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-