Record Class DoctorAdvisory.Metadata

java.lang.Object
java.lang.Record
com.shaft.doctor.model.DoctorAdvisory.Metadata
Record Components:
providerStatus - normalized provider outcome
provider - provider identifier
model - model identifier
configurationIdentifier - non-secret configuration checksum
durationMillis - elapsed provider duration
usage - provider-reported usage
fallbackReason - safe fallback reason
cacheHit - whether the advisory came from the explicit safe cache
warnings - safe validation warnings
Enclosing class:
DoctorAdvisory

public static record DoctorAdvisory.Metadata(com.shaft.pilot.ai.AiResponseStatus providerStatus, String provider, String model, String configurationIdentifier, long durationMillis, com.shaft.pilot.ai.AiUsage usage, String fallbackReason, boolean cacheHit, List<String> warnings) extends Record
Safe provider, timing, usage, cache, and fallback metadata.
  • Constructor Details

    • Metadata

      public Metadata(com.shaft.pilot.ai.AiResponseStatus providerStatus, String provider, String model, String configurationIdentifier, long durationMillis, com.shaft.pilot.ai.AiUsage usage, String fallbackReason, boolean cacheHit, List<String> warnings)
      Creates immutable safe metadata.
  • Method Details

    • asCacheHit

      public DoctorAdvisory.Metadata asCacheHit()
      Returns a cache-hit copy.
      Returns:
      cache-hit metadata
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • providerStatus

      public com.shaft.pilot.ai.AiResponseStatus providerStatus()
      Returns the value of the providerStatus record component.
      Returns:
      the value of the providerStatus record component
    • provider

      public String provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • configurationIdentifier

      public String configurationIdentifier()
      Returns the value of the configurationIdentifier record component.
      Returns:
      the value of the configurationIdentifier record component
    • durationMillis

      public long durationMillis()
      Returns the value of the durationMillis record component.
      Returns:
      the value of the durationMillis record component
    • usage

      public com.shaft.pilot.ai.AiUsage usage()
      Returns the value of the usage record component.
      Returns:
      the value of the usage record component
    • fallbackReason

      public String fallbackReason()
      Returns the value of the fallbackReason record component.
      Returns:
      the value of the fallbackReason record component
    • cacheHit

      public boolean cacheHit()
      Returns the value of the cacheHit record component.
      Returns:
      the value of the cacheHit record component
    • warnings

      public List<String> warnings()
      Returns the value of the warnings record component.
      Returns:
      the value of the warnings record component