Record Class WaitForTraceOptions

java.lang.Object
java.lang.Record
codes.grow.packages.otelcollector.tracing.query.WaitForTraceOptions
Record Components:
timeout - overall wait (default 30 s)
interval - delay between attempts (default 1 s)
minSpans - spans the trace must have (default 1)

public record WaitForTraceOptions(Duration timeout, Duration interval, int minSpans) extends Record
  • Field Details

    • DEFAULT_INTERVAL

      public static final Duration DEFAULT_INTERVAL
      The interval used when none is given. explicitInterval() tells this default apart from an interval the caller chose, so a service can apply its own default (passing this constant itself counts as unset).
  • Constructor Details

    • WaitForTraceOptions

      public WaitForTraceOptions(Duration timeout, Duration interval, int minSpans)
      Fills defaults for null durations.
      Parameters:
      timeout - overall wait
      interval - delay between attempts
      minSpans - minimum spans
  • Method Details

    • defaults

      public static WaitForTraceOptions defaults()
      Defaults: 30 s, 1 s, 1 span.
      Returns:
      defaults
    • explicitInterval

      public Optional<Duration> explicitInterval()
      Returns the interval the caller set, or empty when it was left unset (the record then holds DEFAULT_INTERVAL).
      Returns:
      the explicit interval, if any
    • intervalOr

      public Duration intervalOr(Duration serviceDefault)
      Returns the caller's interval, or serviceDefault when it was left unset.
      Parameters:
      serviceDefault - the service's own default interval
      Returns:
      the interval to use
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • timeout

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • interval

      public Duration interval()
      Returns the value of the interval record component.
      Returns:
      the value of the interval record component
    • minSpans

      public int minSpans()
      Returns the value of the minSpans record component.
      Returns:
      the value of the minSpans record component