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

    Constructors
    Constructor
    Description
    OtlpAnyValue(String stringValue, Boolean boolValue, String intValue, Double doubleValue)
    Creates an instance of a OtlpAnyValue record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the boolValue record component.
    Returns the value of the doubleValue record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the intValue record component.
    Returns the value of the stringValue record component.
    final String
    Returns a string representation of this record class.
    Returns the scalar Java value for this attribute, or null when no scalar variant is set.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OtlpAnyValue

      public OtlpAnyValue(String stringValue, Boolean boolValue, String intValue, Double doubleValue)
      Creates an instance of a OtlpAnyValue record class.
      Parameters:
      stringValue - the value for the stringValue record component
      boolValue - the value for the boolValue record component
      intValue - the value for the intValue record component
      doubleValue - the value for the doubleValue record component
  • Method Details

    • unwrap

      public Object unwrap()
      Returns the scalar Java value for this attribute, or null when no scalar variant is set. intValue arrives as a JSON string per the OTLP encoding and is parsed to a long.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stringValue

      public String stringValue()
      Returns the value of the stringValue record component.
      Returns:
      the value of the stringValue record component
    • boolValue

      public Boolean boolValue()
      Returns the value of the boolValue record component.
      Returns:
      the value of the boolValue record component
    • intValue

      public String intValue()
      Returns the value of the intValue record component.
      Returns:
      the value of the intValue record component
    • doubleValue

      public Double doubleValue()
      Returns the value of the doubleValue record component.
      Returns:
      the value of the doubleValue record component