Package dev.dokimos.server.dto.v1.otlp
Record Class OtlpAnyValue
java.lang.Object
java.lang.Record
dev.dokimos.server.dto.v1.otlp.OtlpAnyValue
public record OtlpAnyValue(String stringValue, Boolean boolValue, String intValue, Double doubleValue)
extends Record
The OTLP
AnyValue union in its JSON encoding. Exactly one field is set per value. Only the
scalar variants are unwrapped to a Java value; array and key/value list variants are ignored when
flattening attributes, which is sufficient for matching and for deriving input/output text.-
Constructor Summary
ConstructorsConstructorDescriptionOtlpAnyValue(String stringValue, Boolean boolValue, String intValue, Double doubleValue) Creates an instance of aOtlpAnyValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theboolValuerecord component.Returns the value of thedoubleValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intValue()Returns the value of theintValuerecord component.Returns the value of thestringValuerecord component.final StringtoString()Returns a string representation of this record class.unwrap()Returns the scalar Java value for this attribute, or null when no scalar variant is set.
-
Constructor Details
-
OtlpAnyValue
Creates an instance of aOtlpAnyValuerecord class.- Parameters:
stringValue- the value for thestringValuerecord componentboolValue- the value for theboolValuerecord componentintValue- the value for theintValuerecord componentdoubleValue- the value for thedoubleValuerecord component
-
-
Method Details
-
unwrap
Returns the scalar Java value for this attribute, or null when no scalar variant is set.intValuearrives as a JSON string per the OTLP encoding and is parsed to a long. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
stringValue
Returns the value of thestringValuerecord component.- Returns:
- the value of the
stringValuerecord component
-
boolValue
Returns the value of theboolValuerecord component.- Returns:
- the value of the
boolValuerecord component
-
intValue
Returns the value of theintValuerecord component.- Returns:
- the value of the
intValuerecord component
-
doubleValue
Returns the value of thedoubleValuerecord component.- Returns:
- the value of the
doubleValuerecord component
-