Record Class HttpExecutorContext

java.lang.Object
java.lang.Record
bg.codexio.ai.openai.api.http.HttpExecutorContext
Record Components:
credentials -
timeouts -

public record HttpExecutorContext(ApiCredentials credentials, HttpTimeouts timeouts) extends Record
Context object holding authentication and timeout configuration
  • Constructor Details

    • HttpExecutorContext

      public HttpExecutorContext(ApiCredentials credentials)
      Constructing the object with default timeouts. 3 minutes for call, connect and read.
    • HttpExecutorContext

      public HttpExecutorContext(ApiCredentials credentials, HttpTimeouts timeouts)
      Creates an instance of a HttpExecutorContext record class.
      Parameters:
      credentials - the value for the credentials record component
      timeouts - the value for the timeouts record component
  • Method Details

    • withCallTimeout

      public HttpExecutorContext withCallTimeout(long timeout, TimeUnit timeUnit)
    • withConnectTimeout

      public HttpExecutorContext withConnectTimeout(long timeout, TimeUnit timeUnit)
    • withReadTimeout

      public HttpExecutorContext withReadTimeout(long timeout, TimeUnit timeUnit)
    • 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.
    • credentials

      public ApiCredentials credentials()
      Returns the value of the credentials record component.
      Returns:
      the value of the credentials record component
    • timeouts

      public HttpTimeouts timeouts()
      Returns the value of the timeouts record component.
      Returns:
      the value of the timeouts record component