Package io.opentelemetry.api.common
Class ValueLong
- java.lang.Object
-
- io.opentelemetry.api.common.ValueLong
-
-
Field Summary
Fields Modifier and Type Field Description private long
value
-
Constructor Summary
Constructors Modifier Constructor Description private
ValueLong(long 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.lang.Long>
create(long value)
boolean
equals(java.lang.Object o)
ValueType
getType()
Returns the type of thisValue
.java.lang.Long
getValue()
Returns the value for thisValue
.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
create
static Value<java.lang.Long> create(long value)
-
getType
public ValueType getType()
Description copied from interface:Value
Returns the type of thisValue
. Useful for building switch statements.
-
getValue
public java.lang.Long 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
-
-