Package io.opentelemetry.api.common
Class ValueBytes
java.lang.Object
io.opentelemetry.api.common.ValueBytes
- All Implemented Interfaces:
Value<ByteBuffer>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
raw
private final byte[] raw
-
-
Constructor Details
-
ValueBytes
private ValueBytes(byte[] value)
-
-
Method Details
-
create
-
getType
Description copied from interface:Value
Returns the type of thisValue
. Useful for building switch statements.- Specified by:
getType
in interfaceValue<ByteBuffer>
-
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()
.
- Specified by:
getValue
in interfaceValue<ByteBuffer>
-
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.
- Specified by:
asString
in interfaceValue<ByteBuffer>
-
toString
-
equals
-
hashCode
public int hashCode()
-